Bug #91894

Cast transOrigPointerField value to integer to ensure return type matches

Added by Daniel Siepmann 10 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Should have
Category:
-
Start date:
2020-07-30
Due date:
% Done:

100%

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

Description

When using sqlite, data fetched from DB is not of expected data types.
Therefore some return type hints will break.

In order to not break resolvePreviewRecordId(), there has to be a cast.

This prevents users from editing translated records.

#1

Updated by Gerrit Code Review 10 months ago

  • Status changed from New 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/c/Packages/TYPO3.CMS/+/65139

#2

Updated by Gerrit Code Review 10 months 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/c/Packages/TYPO3.CMS/+/65139

#3

Updated by Daniel Siepmann 10 months ago

  • Description updated (diff)
#4

Updated by Anja Leichsenring 10 months ago

how did you find out? Some steps to reproduce the issue would be helpful in testing the change (and yes I realize it is minor). We might run into this root case elsewhere, too.

#5

Updated by Daniel Siepmann 10 months ago

Sure, sorry.

Translate a record (e.g. tt_content or sys_category).
Use sqlite as DBMS.
Open the edit form of the translated record.

This should result in an error: `Return value of TYPO3\CMS\Backend\Controller\EditDocumentController::resolvePreviewRecordId() must be of the type int, string returned`.

I'm running my website on sqlite for this reason. But only use translations for a specific test right now.
The multiple possible locations are one reason I'm using sqlite. That way I'll find those bugs and can fix them.

#6

Updated by Gerrit Code Review 10 months 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/c/Packages/TYPO3.CMS/+/65139

#7

Updated by Gerrit Code Review 9 months ago

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

#8

Updated by Gerrit Code Review 9 months ago

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

#9

Updated by Daniel Siepmann 9 months ago

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

Updated by Benni Mack 8 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF