Project

General

Profile

Actions

Bug #79692

closed

Error when "Edit the whole template record"

Added by Timo Hund almost 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Start date:
2017-02-08
Due date:
% Done:

100%

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

Description

When i click on "Edit the whole Template Record" in the backend, i currently get the following error:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: strtoupper() expects parameter 1 to be string, integer given | TypeError thrown in file /app/htdocs/typo3_src/typo3/sysext/backend/Classes/Form/FormDataProvider/EvaluateDisplayConditions.php in line 205. Requested URL

I guess that this happens because of the strict type check:

declare(strict_types=1);

...

$logicalOperator = strtoupper($logicalOperator);
if (($logicalOperator !== 'AND' && $logicalOperator !== 'OR') || !is_array($groupedDisplayConditions)) {
throw new \RuntimeException(
'Multiple conditions must have boolean operator "OR" or "AND", "' . $logicalOperator . '" given.',
1481380393
);
}
...

I think the value should be casted to string before passing it to strtoupper.

Actions #1

Updated by Georg Ringer almost 8 years ago

  • Status changed from New to Needs Feedback

I can not reproduce that. can you test on a clean installation? is there something special in the record?

Actions #2

Updated by Timo Hund almost 8 years ago

Hi Georg,

i've investigated this further. I stumbled upon this issue by using t3kit with the latest TYPO3 master branch.

I think there are two issues:

The themese extension has an invalid displayCondition (typo3conf/ext/themes/Configuration/TCA/Overrides/sys_template.php):

'displayCond' => [
'FIELD:root:REQ:true'
],

Which should be from my undestanding:

'displayCond' => 'FIELD:root:REQ:true'

But nevertheless the ConditionParser does not come to the point to evaluate the operator because strtoupper fails on the wrong input type. I think the parser should cast the operator to string before checking if it is AND or OR.

Actions #3

Updated by Benni Mack almost 8 years ago

  • Target version changed from 8.6 to 8 LTS
Actions #4

Updated by Thomas Deuling over 7 years ago

I can confirm that behaviour. So, for our themes extension we just fixed that TCA issue - see:
https://github.com/typo3-themes/themes/blob/8-0/Configuration/TCA/Overrides/sys_template.php#L10

Actions #5

Updated by Benni Mack over 7 years ago

  • Target version changed from 8 LTS to Candidate for patchlevel
Actions #6

Updated by Alexander Opitz about 7 years ago

  • Status changed from Needs Feedback to New
Actions #7

Updated by Gerrit Code Review about 6 years 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/58480

Actions #8

Updated by Gerrit Code Review about 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/58480

Actions #9

Updated by Benni Mack about 6 years ago

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

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions #11

Updated by Gerrit Code Review about 6 years ago

  • Status changed from Closed to Under Review

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/58736

Actions #12

Updated by Benni Mack about 6 years ago

  • Status changed from Under Review to Resolved
Actions #13

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF