Bug #82756

Can't remove access starttime / endtime

Added by Mike van Dee almost 4 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
Start date:
2017-10-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
hard
Is Regression:
Sprint Focus:

Description

I can't remove the access start and endtime of tt_content block.

Create a tt_content block. Set start and or end time under the access tab. Save it. When you remove the start or end time an error will popup.

2: SQL error: 'Incorrect integer value: '' for column 'starttime' at row 1' (tt_content:44)

I use typo3 version 8.7.7


Related issues

Related to TYPO3 Core - Bug #78921: Copying records fails with SQL error without any messageNew2016-12-08

Actions
Related to TYPO3 Core - Task #72610: Officially support MySQL Strict ModeClosedMorton Jonuschat2016-01-08

Actions
Related to TYPO3 Core - Bug #63735: High memory consumption in DataHandler->checkValue_SW while bulk insertingClosed2014-12-10

Actions
Has duplicate TYPO3 Core - Bug #82872: Unassigning "date" from content element is not possibleRejected2017-10-27

Actions
Has duplicate TYPO3 Core - Bug #83648: Emptying datetime causes SQL errorClosed2018-01-23

Actions
#1

Updated by Michael Stucki almost 4 years ago

  • Project changed from forge.typo3.org to TYPO3 Core
  • TYPO3 Version set to 8
#2

Updated by Susanne Moog almost 4 years ago

  • Category set to FormEngine aka TCEforms
#3

Updated by Wouter Wolters almost 4 years ago

  • Status changed from New to Needs Feedback

This works on my system. Looks like your column in the database has a wrong default value or some hook is involved.
Can you setup a clean TYPO3 and try again?

#4

Updated by Mike van Dee almost 4 years ago

Wouter Wolters wrote:

This works on my system. Looks like your column in the database has a wrong default value or some hook is involved.
Can you setup a clean TYPO3 and try again?

I use strict MySQL(5.7.17) database.
The tt_content table has fields:
`starttime` int(10) unsigned NOT NULL DEFAULT '0',
`endtime` int(10) unsigned NOT NULL DEFAULT '0',

When you clear the start/endtime an empty string('') is send to the database.

Clearing start/endtime works in typo3 version 8.7.1 or lower. And gives me an error on version 8.7.2 and higher.

#5

Updated by Tymoteusz Motylewski almost 4 years ago

  • Related to Bug #78921: Copying records fails with SQL error without any message added
#6

Updated by Wouter Wolters almost 4 years ago

  • Has duplicate Bug #82872: Unassigning "date" from content element is not possible added
#7

Updated by Wouter Wolters almost 4 years ago

  • Status changed from Needs Feedback to Accepted

Was confirmed by Andreas F.

#8

Updated by Wouter Wolters over 3 years ago

  • Has duplicate Bug #83648: Emptying datetime causes SQL error added
#9

Updated by Daniel Siepmann over 3 years ago

As far as I know, TYPO3 does not work with MySQL strict mode.
I can't find where it's documented, but we do not experience the same issue if we turn off strict mode.

#10

Updated by Mike van Dee over 3 years ago

Daniel Siepmann wrote:

As far as I know, TYPO3 does not work with MySQL strict mode.
I can't find where it's documented, but we do not experience the same issue if we turn off strict mode.

Here is an forge task that implies that typo3 supports MySQL Strict mode. https://forge.typo3.org/issues/72610

#11

Updated by Rick Feuerabend over 3 years ago

as a workaround adding "int" eval additionally does the trick!
with that datetime or date fields can be set empty without MySQL Error

e.g.

$GLOBALS['TCA']['tt_content']['columns']['starttime']['config']['eval'] .= ',int';

Can someony please apply the fixes in the core?

#12

Updated by Oliver Hader over 3 years ago

  • Category changed from FormEngine aka TCEforms to DataHandler aka TCEmain
#13

Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56062

#14

Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56062

#15

Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56064

#16

Updated by Oliver Hader over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#17

Updated by Rudy Gnodde over 3 years ago

  • % Done changed from 100 to 0

Shouldn't this actually be fixed instead of using the workaround in the core? This patch doesn't fix it for extensions that also use datetime fields. I'm not very familiar with the DataHandler, but can't you cast it to int or set it to zero if a field has eval date/datetime and the value is an empty string?

#18

Updated by Markus Klein over 3 years ago

  • Related to Task #72610: Officially support MySQL Strict Mode added
#19

Updated by Markus Klein over 3 years ago

  • Status changed from Resolved to Accepted
  • Complexity set to hard

We reopen this ticket.

The issues we are facing currently are:

  • MySQL in strict mode does not accept an empty string written to an integer database field
  • The TCA default value is only applied to fields on creation of new records, not when updating one. (E.g. removing an endtime)
  • Writing a correct integer value to a database that uses another datatype for this field (e.g. a varchar) will fail on certain DMBS too, for instance MS SQL Server
  • FormEngine currently does not support NULL values for these fields (NULL means "unknown / undefined", whereas 0 has a defined meaning for (date)time), which would be the correct value when not specifying a date.

The solution to all these problem is not doable with a bugfix but requires a more thorough refactoring to the core.

Due to these reasons we applied a workaround as a first counter-measure to the core, but for your extensions you have to apply the workaround as well.

#20

Updated by Oliver Hader over 3 years ago

  • Target version set to 8.7.11
#21

Updated by Oliver Hader over 3 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100
#22

Updated by Oliver Hader over 3 years ago

  • Related to Bug #63735: High memory consumption in DataHandler->checkValue_SW while bulk inserting added
#23

Updated by Benni Mack almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF