Project

General

Profile

Actions

Bug #52596

closed

Creating pages tries to assign empty string to integer field

Added by Tomas Norre Mikkelsen over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
Start date:
2013-10-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

I recently discovered an issue after upgrading to MySQL 5.6 when creating pages.

When creating a page, following $fieldArray is tried to be inserted.

array (\n
'doktype' => '1',\n
'hidden' => '1',\n
'starttime' => '0',\n
'endtime' => '0',\n
'layout' => '0',\n
'url_scheme' => 0,\n
'urltype' => '1',\n
'lastUpdated' => '0',\n
'newUntil' => '0',\n
'cache_timeout' => '0',\n
'shortcut_mode' => '0',\n
'module' => '',\n
'backend_layout' => '',\n
'backend_layout_next_level' => '',\n
'perms_userid' => '1',\n
'perms_groupid' => 0,\n
'perms_user' => 31,\n
'perms_group' => 27,\n
'perms_everybody' => 0,\n
'sorting' => 256,\n
'pid' => 0,\n
'title' => '[Default Title]',\n
'crdate' => 1381052264,\n
'cruser_id' => '1',\n
'tstamp' => 1381052264,\n
't3ver_stage' => 0,\n
),

Which is ok, but the backend_layout and backend_layout_next_level fields are both set as empty strings '', which is tried to set into integer fields. This is a problem with MySQL 5.6 default setup cause it uses: sql_mode=STRICT_TRANS_TABLES ( or at least in osx it does)

This can for sure just be changes, but it might be a wanted configuration for some and it should be supported by TYPO3 too.

The "issue" as I see it is:

Why try to assign an empty string to an integer field. If the wanted behaviour is that it should be the default values, these should not be set in the fieldArray but be handled by the table definitions.

I don't have a solution for this, just wanted to address the issue.

I'll be glad helping figuring out this issue. But the main idea was to address the issue so we know which direction we should go.

Cheers

Is for sure related to:
http://forge.typo3.org/issues/18866


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #18866: Cannot create page with Mysl in strict mode (STRICT_TRANS_TABLES)RejectedAlexander Opitz2008-05-28

Actions
Actions #1

Updated by Alexander Stehlik over 10 years ago

There seems to be a general problem with Backend Layouts for new pages. When a new page is created the fields in the database backend_layout and backend_layout_next_level contain empty strings.

But the BackendLayoutView only checks for values === '0' when searching for pages with no explicit Backend Layout. So when if finds an empty string it will assume that there is a Backend Layout set in that page (which of course is not).

I see two solutions for that problem:

  1. change the default value of backend_layout and backend_layout_next_level back to zero
  2. change the value in the Backend Layout selector also to an empty string instead of zero and adjust the check in BackendLayoutView so that it can handle empty strings

Remark on the second solution:

We need either to handle empty strings AND zeros to be backward compatible or we need an updater in the install tool.

Actions #2

Updated by Gerrit Code Review over 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24882

Actions #3

Updated by Gerrit Code Review over 10 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/24882

Actions #4

Updated by Gerrit Code Review over 10 years ago

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

Actions #5

Updated by Gerrit Code Review over 10 years ago

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

Actions #6

Updated by Alexander Stehlik over 10 years ago

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

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF