Bug #16569
closedNew content elements wizard removes CE from array, which are OK!
0%
Description
class SC_db_new_content_el has function removeInvalidElements to remove CE the user has no rights for or which are defined by TSconfig CType.removeItems.
The function checks values of tt_content_defValues towards removeItems instead the CType key. So CEs where an tt_content_defValues value is zero, are removed.
[OK, zero tt_content_defValues are unnecessary, but otherwise this bug would be undiscovered]
(issue imported from #M4226)
Files
Updated by Marc Bastian Heinrichs almost 18 years ago
Hi Ingmar,
an 1liner for 4.1?
Updated by Oliver Hader over 17 years ago
Hi,
sorry, I didn't get the point when looking to your patch.
An item of the array $wizardItems looks like the following:
[common_textImage] => Array
(
[icon] => gfx/c_wiz/text_image_right.gif
[title] => Text with image
[description] => Any number of images wrapped right around a regular text element.
[tt_content_defValues] => Array
(
[CType] => textpic
[imageorient] => 17
)
)
In this case we have this assignment to variables:
$key = 'common_textImage'
$fV = 'textpic'
In PageTSconfig you can remove these items by writing e.g. "TCEFORM.tt_content.CType.removeItems = bullets"
According to your patch in future we have to write "TCEFORM.tt_content.CType.removeItems = common_textImage"
Updated by Marc Bastian Heinrichs over 17 years ago
Hi Oliver,
you are right, for sure! Can't remember my thoughts, when "fixing" this no-bug. :-)
The simple problem is, that for example in_array(0,array('header','multimedia')) is true. damn.
So close this, please. THX
Updated by Marc Bastian Heinrichs over 17 years ago
One more remark:
Perhaps it makes sense, if $fN would check for 'CType' also, otherwise setting another tt_content_defValues with the default value of an content type will cause unsetting the type, too.
if ($authModeDeny || (in_array($fV,$removeItems) && $fN == 'CType))
Updated by Oliver Hader over 17 years ago
Marc Bastian, I had the same feeling while walking over the code with checking only CType in future.
Updated by Marc Bastian Heinrichs over 17 years ago
Hi Ingmar,
jep, Olivers patch has been tested and it works as expected.
THX to Oliver for fixing.
cheers
MB
Updated by Oliver Hader over 17 years ago
Steps to reproduce this issue:
Imagine you have an extension that extends tt_content by servel fields. Furthermore there is a wizard item which should be shown on creating a new content element - this is defined by e.g. the following:
$wizardItems['plugins_tx_myext_pi1'] = array( 'icon' => t3lib_extMgm::extRelPath('my_ext').'pi1/ce_wiz.gif', 'title' => $LANG->getLLL('pi1_title',$LL), 'description' => $LANG->getLLL('pi1_plus_wiz_description',$LL), 'params' => '&defVals[tt_content][CType]=list' . '&defVals[tt_content][list_type]=my_ext' . '&defVals[tt_content][tx_myext_field]=bullets' );
And furthermore imagine a page TSconfig like this:
TCEFORM.tt_content.CType.removeItems = bullets,uploads,multimedia
Since the user extension has a property "tx_myext_field" which is set to "bullets" and the regular content element of tt_content with the type "bullets" should be removed, the current situation in the Core would remove both.
Updated by Oliver Hader over 17 years ago
Committed to SVN - TYPO3_4-1 (rev. 2356) and Trunk (rev. 2357)