Project

General

Profile

Actions

Bug #82756

closed

Can't remove access starttime / endtime

Added by Mike van Dee about 7 years ago. Updated about 6 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 5 (1 open4 closed)

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
Actions #1

Updated by Michael Stucki about 7 years ago

  • Project changed from 9 to TYPO3 Core
  • TYPO3 Version set to 8
Actions #2

Updated by Susanne Moog about 7 years ago

  • Category set to FormEngine aka TCEforms
Actions #3

Updated by Wouter Wolters about 7 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?

Actions #4

Updated by Mike van Dee about 7 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.

Actions #5

Updated by Tymoteusz Motylewski about 7 years ago

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

Updated by Wouter Wolters about 7 years ago

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

Updated by Wouter Wolters about 7 years ago

  • Status changed from Needs Feedback to Accepted

Was confirmed by Andreas F.

Actions #8

Updated by Wouter Wolters almost 7 years ago

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

Updated by Daniel Siepmann almost 7 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.

Actions #10

Updated by Mike van Dee almost 7 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

Actions #11

Updated by Rick Feuerabend almost 7 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?

Actions #12

Updated by Oliver Hader over 6 years ago

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

Updated by Gerrit Code Review over 6 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

Actions #14

Updated by Gerrit Code Review over 6 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

Actions #15

Updated by Gerrit Code Review over 6 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

Actions #16

Updated by Oliver Hader over 6 years ago

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

Updated by Rudy Gnodde over 6 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?

Actions #18

Updated by Markus Klein over 6 years ago

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

Updated by Markus Klein over 6 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.

Actions #20

Updated by Oliver Hader over 6 years ago

  • Target version set to 8.7.11
Actions #21

Updated by Oliver Hader over 6 years ago

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

Updated by Oliver Hader over 6 years ago

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

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF