Bug #21665
closed
rendering a custom edit panel via pi_base results in an exception
Added by Björn Pedersen about 15 years ago.
Updated over 11 years ago.
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
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.
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
- 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)?
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.
- Status changed from Needs Feedback to Closed
Also available in: Atom
PDF