Be part of the future of TYPO3! Support Gridelements now and unlock exclusive early access to v13! The well-established Gridelements V12 elevates TYPO3 by bringing grid-based layouts to content elements, with powerful features like advanced drag & drop and real references. Supercharge your workflow and make daily tasks easier. Sponsor us here:
The following inconsistency should not happen and will cause existing elements to disappear (in list and page view):
elements have tx_gridelements_container != 0 and colpos=-1, but the container is not a gridelement type
Reproduce
Create a gridelement with children
change the CType of the gridelement (e.g. to textmedia).
Result: The children will then "disappear" in list and page view
SQL select for showing these records
SELECT t1.uid,t1.pid,t1.sys_language_uid,t1.ctype,t1.header,t2.uid,t2.pid,t2.header,t2.ctype
FROM tt_content t1
INNER JOIN tt_content t2
ON t1.tx_gridelements_container=t2.uid
WHERE t1.colpos=-1
AND t1.tx_gridelements_container != 0
AND t2.ctype NOT LIKE 'gridelements_pi1'
AND NOT t1.deleted
AND NOT t2.deleted;
UPDATE tt_content t1
INNER JOIN tt_content t2
ON t1.tx_gridelements_container=t2.uid
SET t1.colpos=0,t1.tx_gridelements_container=0
WHERE t1.colpos=-1
AND t1.tx_gridelements_container != 0
AND t2.ctype NOT LIKE 'gridelements_pi1'
AND NOT t1.deleted
AND NOT t2.deleted;
Possible solutions
Create a scheduler task to clean up existing records. For these records, set colpos to 0 (or the default) and tx_gridelements_container to 0. In general, if the records are cleaned up, I think it is a good idea to make the elements "hidden" by default, otherwise elements will suddenly "reappear" which were formerly hidden.
or prevent this from happening: it should not be possible to change the ctype
or if the ctype is changed, the elements should be released from the parent or deleted
The following inconsistency should not happen and will cause existing elements to disappear (in list and page view):
Reproduce
Result: The children will then "disappear" in list and page view
SQL select for showing these records
Possible solutions
Create a scheduler task to clean up existing records. For these records, set colpos to 0 (or the default) and tx_gridelements_container to 0. In general, if the records are cleaned up, I think it is a good idea to make the elements "hidden" by default, otherwise elements will suddenly "reappear" which were formerly hidden.
or prevent this from happening: it should not be possible to change the ctype
or if the ctype is changed, the elements should be released from the parent or deleted
Related