#106323Import throws error because inline fields has no DB default value
Description
Hi!
I get an error when trying to import a t3d or xml file. (test data is an empty page)
TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(): Argument #2 ($string) must be of type string, null given, called in /var/www/html/vendor/typo3/cms-core/Classes/DataHandling/DataHandler.php on line 2586
the problem is an inline field on the page table that has no default value in the DB
in this case from the blog extension:
CREATE TABLE pages (
comments text,
'comments' => [
'label' => $ll . 'pages.comments',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_blog_domain_model_comment',
'foreign_field' => 'parentid',
'foreign_table_field' => 'parenttable',
'size' => 10,
'maxitems' => 9999,
'autoSizeMax' => 30,
'multiple' => 0,
'appearance' => [
'collapseAll' => 1,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'showAllLocalizationLink' => 1,
],
],
],
setting $valueArray in the checkValueForInline function to [] when $value is null should fix it, but who knows what that would ruin elsewhere :D
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 1
History 5
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2025-03-06T17:09:03+00:00" > 03/06/25, 17:09 </span> -
Manuel Winkelhofer commented <span data-processor="relativetime" data-value="2025-03-07T07:44:20+00:00" > 03/07/25, 07:44 </span>
hey!
i don’t think the properties default or nullable work for inline fields or do they?
nonetheless, there isn’t a ticket right now i will report it there.
thx
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2025-03-07T08:33:39+00:00" > 03/07/25, 08:33 </span>
Thanks for the reply. The TCA evaluates and sets a ‘default’ value, if the TCA automatic creation of tables is possible. However, since EXT:blog ships its own ext_tables.sql that has precedence.
In your case, you could probably also create a custom ext_tables.sql in your sitepackage (if that depends on EXT:blog) and then override the column with a “NULL” (or default ‘0’) yourself? Because if the extension drops that ext_tables.sql definition, it will need to drop TYPO3 v12 compatibility too. So likely EXT:blog will add a null/default definition there, I guess/hope? :)
Is it ok with you to close the issue here?
-
Manuel Winkelhofer commented <span data-processor="relativetime" data-value="2025-03-07T11:26:27+00:00" > 03/07/25, 11:26 </span>
yes you can close this ticket, thanks.
-
Garvin Hicking commented and changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2025-03-07T12:50:10+00:00" > 03/07/25, 12:50 </span>Thx!
Hi!
My feeling is that this should be fixed on extension-level, so the blog extension would need to either provide an ext_tables.sql with a compatible key or the TCA config keys ‘default’ or ‘nullable’ should be provided, so that either a default is applied, or for automatica TCA creation the field is created as nullable.
This will otherwise fall flat on more cases than just T3D import.
Could/would you check if the blog extension has listed this as an issue already, and otherwise maybe report it there?
Best regards,
Garvin