Project

General

Profile

Actions

Bug #21665

closed

rendering a custom edit panel via pi_base results in an exception

Added by Björn Pedersen over 14 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2009-11-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

cause:
in class.tslib_content.php, function editPanel,

dataArray is overwritten with $this->data, even if $this->data is not an array.

Solution: add an is_array check for $this->data.

changing line 7912 to:
if (!count($dataArr)&&is_array($this->data)) {

see also: http://forge.typo3.org/issues/show/5474
(issue imported from #M12729)


Files

class_tslib_content.patch (398 Bytes) class_tslib_content.patch Administrator Admin, 2009-11-25 08:31
Actions #1

Updated by Björn Pedersen over 14 years ago

It seems to be a combination of an unlucky extension programming:
$this->data is empty, instead everything is in $this->cObj->data.

But I can't find the part where changed this( kickstarter generated extension).

But i think it should still get caught by tslib_content in any case.

Actions #2

Updated by Björn Pedersen over 14 years ago

I did again more investigations:
in pibase->pi_getEditpanel a temporay CObject is created. If either the first ($row ) or the second argument ($tablename) evaluate to false, they are initialised from $this->internal['currentRow']; and
$this->internal['currentTable'];

If used with 2 empty strings as dummy arguments, and these fallback values are not set as array() and string, then the error occurs.

Possible fixes: In the extension use:
$this->pi_getEditPanel(array(''),'<table name>','',$econf));

In core:
1.
pi_base->pi_getEditPanel()
check the validity of the fallbacks as well and supply useful defaults.
2. tslib_content->editPanel:
check $this->data as in my patch

Actions #3

Updated by Alexander Opitz almost 11 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (-1)
  • TYPO3 Version set to 4.3

The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?

Actions #4

Updated by Björn Pedersen almost 11 years ago

I just TYPO3 4.7 code: No fixes have been done to the code. But my understanding was, that it is more a extension programming error:

do not use:

pi_base->pi_getEditPanel('','')

but use:
pi_getEditPanel(array(''),'<table name>','',$econf));

So I would also be fine with closing this bug.

Actions #5

Updated by Alexander Opitz almost 11 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF