Closed rtoenjes closed 3 years ago
I have the same issue. TYPO3 v9, PHP 7.2, mariadb 10.2 Setting a default of 0 helps:
$GLOBALS['TCA']['tt_content']['columns']['youtubevideo_startminute']['config']['default'] = 0;
$GLOBALS['TCA']['tt_content']['columns']['youtubevideo_startsecond']['config']['default'] = 0;
Sry for the late reply. I guess this should do it? tx_youtubevideo_startminute int(11) DEFAULT '0', tx_youtubevideo_startsecond int(11) DEFAULT '0', Not possible to test right now...pushed it to the master thou.
Unfortunately that didn't help in my case. TYPO3 9.5.16, PHP 7.3, Mariadb 10.2. Mysql still reports:
SQL error: 'Incorrect integer value: '' for column
db
.tt_content
.tx_youtubevideo_startminute
at row 1'
Looks like a database / TCA mismatch issue, the TCA default = 0 workaround helps though.
This happens because of MySQL strict mode, which is default since 5.7. It can be fixed by adding default (and to be super save eval) to the integer fields.
I created a PR for that: https://github.com/t3brightside/youtubevideo/pull/9
Could you tag the current master with 1.4.1 then this is fixed and comfortable installable.
I'll look over it sometime soon. Not really happiest with the solution where it shows zeros in the form by default. It should be just empty if it's not in use. Any ideas?
Maybe you can work with NULL so by default the inputs are disabled and you have to check a box if you want to set a value:
default => null
eval => null
and in Database:
tx_youtubevideo_startminute int(11) DEFAULT NULL
tx_youtubevideo_startsecond int(11) DEFAULT NULL
@moe2k not a bad idea, but I think it's a bit too much UX wise as well. Anyhow I have created a new tag for now, I'll close the issue for now, maybe one day there will be better solution for this. Thanks everybody!
maybe eval => int without the default does the trick..? But have not checked jet.
When inserting a video via BE there are errors:
I have to add a startminute = 0 and a startsecond = 0 by hand to add a video.
The table seem to be ok with:
Any advices?