fnagel / generic-gallery

TYPO3 extension: Generic Gallery - One gallery to rule them all!
https://extensions.typo3.org/extension/generic_gallery/
GNU General Public License v3.0
7 stars 12 forks source link

SQL error: 'Incorrect integer value: '' for column `c1_SQL01`.`tt_content`.`tx_generic_gallery_collection` at row 1' #35

Closed SicorDev closed 2 years ago

SicorDev commented 3 years ago

Hi there,

I got the above error when trying to copy a newsletter with lots of elements, gridelements and images amongst others. Actually no gallery though...

To make it go away I had to deactivate the inline usage of sys_file_collection in the extension options, as well as add

'default' => 0,

to the config for 'tx_generic_gallery_collection' in

generic_gallery/Configuration/TCA/Overrides/tt_content.php

No idea how to fix the inline variant...

Greetings, Manuel

fnagel commented 3 years ago

Hey Manuel!

Which version of TYPO3 are you using?

Sounds this could be an issue with the mode of your SQL mode, see https://git.typo3.org/Packages/TYPO3.CMS.git/blob/c5f567c36689e197c6b25e9e2d3adfe50c12f610:/INSTALL.md#l305 Link changed to https://git.typo3.org/typo3/typo3/-/blob/c5f567c36689e197c6b25e9e2d3adfe50c12f610/INSTALL.md#L305-315 https://forge.typo3.org/issues/54883

If SQL mode is correct, please try if this solution helps: https://stackoverflow.com/a/50138799/991681

fnagel commented 3 years ago

Any feedback on this issue?

fnagel commented 2 years ago

Closed as no feedback was given. Please reopen or create a new ticket if needed.

twaurisch commented 2 years ago

Yes, if using "strict mode" this error occours while copying a tt_content object. The strict mode also is activated in the DDEV default configuration. In case somebody is not able to disable this, it would be nice to update the TCA for the field tx_generic_gallery_collection

'tx_generic_gallery_collection' => [
    'config' => [
        ...
        'default' => 0,
        ...
    ],
],

This would make this Extension more compatible and mor bullet-proof.

fnagel commented 2 years ago

Afaik strict mode is not supported by TYPO3 CMS or am I missing something? Anyway, if this does not break anything we can fix it. Which TYPO3 version are you using?

twaurisch commented 2 years ago

I use TYPO3 v10 and v11. The 'default" => 0 configuration is also used in the core. You can find it context of a record relation in the pages TCA for the field 'l10n_parent'. Thanks.

fnagel commented 2 years ago

It's really hard to find some proper documentation for this. Nothing good in the official docs. EXT:news does not use a default for group and inline type fields: https://github.com/georgringer/news/blob/main/Configuration/TCA/tx_news_domain_model_news.php and neither does https://github.com/TYPO3GmbH/blog/blob/master/Configuration/TCA/

Is this only needed for the tx_generic_gallery_collection field? And if so, for both types (group and inline)? In the core, I've seen fields with a default config for group type fields.

For TYPO3 10 there is a release in the making but for TYPO3 11 I need to backport some more changes, which will take some more time.

Some references: https://forge.typo3.org/issues/68397

twaurisch commented 2 years ago

Take your time and put it into the next release. I put a override into my sitepackage as a workaround.

PS: good research related to this topic, thanks

fnagel commented 2 years ago

@fnagel Any feedback on where the fix is needed?

Is this enough? https://github.com/fnagel/generic-gallery/commit/9be182143204444033800fa18e7137ebf11df932

Or is it needed here too? https://github.com/fnagel/generic-gallery/blob/9be182143204444033800fa18e7137ebf11df932/Configuration/TCA/Overrides/tt_content.php#L100-L110

twaurisch commented 2 years ago

I just traced it in v10. The result, in this case it's only needed for the group type.

fnagel commented 2 years ago

Thanks for the feedback! TER release for 4.x is on its way :-)