Project

General

Profile

Actions

Bug #16569

closed

New content elements wizard removes CE from array, which are OK!

Added by Marc Bastian Heinrichs over 17 years ago. Updated almost 16 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2006-09-15
Due date:
% Done:

0%

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

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

4226.patch (554 Bytes) 4226.patch Administrator Admin, 2006-09-15 14:13
0004226.patch (717 Bytes) 0004226.patch Administrator Admin, 2007-05-12 14:24
Actions #1

Updated by Marc Bastian Heinrichs over 17 years ago

here is the patch

Actions #2

Updated by Marc Bastian Heinrichs about 17 years ago

Hi Ingmar,
an 1liner for 4.1?

Actions #3

Updated by Oliver Hader almost 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"

Actions #4

Updated by Marc Bastian Heinrichs almost 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

Actions #5

Updated by Marc Bastian Heinrichs almost 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))

Actions #6

Updated by Oliver Hader almost 17 years ago

Marc Bastian, I had the same feeling while walking over the code with checking only CType in future.

Actions #7

Updated by Marc Bastian Heinrichs almost 17 years ago

Hi Ingmar,

jep, Olivers patch has been tested and it works as expected.

THX to Oliver for fixing.

cheers
MB

Actions #8

Updated by Oliver Hader almost 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.

Actions #9

Updated by Oliver Hader almost 17 years ago

Committed to SVN - TYPO3_4-1 (rev. 2356) and Trunk (rev. 2357)

Actions

Also available in: Atom PDF