[TYPO3-core] RFC #16096 Bug: addToAllTCATypes after certain fields does not work anymore

JoH asenau info at cybercraft.de
Fri Dec 17 16:54:14 CET 2010


>> Using
>> 
>> t3lib_extMgm::addToAllTCAtypes('tt_content','tx_damttcontent_files','textpic','replace:image');
>> 
>> replaces the image field properly, but adds three more DAM images
>> fields after each image other pallette (Click response for images,
>> Image settings, Image block settings). Am I the only one to
>> experience such an effect?
> 
> I just tested it with dam_pages and it worked as expected.
> Will do some further testing with other settings.

The search pattern for both, palettes and types, has been missing a closing word boundary.
This made the pattern match any fieldname starting with the search term, which is no problem for "media" in pages, but for "image" in tt_content.

preg_match('/\b' . $needle. '/', $haystack)

should be changed to

preg_match('/\b' . $needle. '\b/', $haystack)

Attached patch fixes this bug and is tested with dam_ttcontent as well.

Cheers

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16096_v5.diff
Type: application/octet-stream
Size: 6199 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101217/a86b7254/attachment.obj>


More information about the TYPO3-team-core mailing list