IchHabRecht / content_defender

Define allowed or denied content element types in your backend layouts
GNU General Public License v2.0
81 stars 38 forks source link

PHP warning with content elements created inside a news record #144

Open amirarends opened 1 year ago

amirarends commented 1 year ago

Had a warning issue during inserting a new news record in TYPO3 v11 and PHP8.0.

In our configuration we use the news extension with the possibility to add content elements to the field "content_elements": https://docs.typo3.org/p/georgringer/news/main/en-us/Tutorials/Templates/RenderContentElements/Index.html

In this case, TYPO3 can not provide the colPos, because it is not existent.

All tt_content-records which are created inside a news record, are saved with colPos=0 in DB.

mbrodala commented 10 months ago

I can confirm the same issue for custom records which have an inline field for tt_content records.

The setup triggering the error uses overrideChildTca to limit the visible textmedia fields via showitem. Here we do not have colPos ATM. TYPO3 itself deals with this just fine though.

In any case we avoid the warning by adding colPos to the showitem list.

amirarends commented 10 months ago

https://github.com/IchHabRecht/content_defender/pull/143/files

mbrodala commented 10 months ago

@amirarends You mean https://github.com/IchHabRecht/content_defender/pull/143