Bug #79692

Error when "Edit the whole template record"

Added by Timo Hund over 4 years ago. Updated over 2 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.

#1

Updated by Georg Ringer over 4 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?

#2

Updated by Timo Hund over 4 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.

#3

Updated by Benni Mack over 4 years ago

  • Target version changed from 8.6 to 8 LTS
#4

Updated by Thomas Deuling over 4 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

#5

Updated by Benni Mack over 4 years ago

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

Updated by Alexander Opitz about 4 years ago

  • Status changed from Needs Feedback to New
#7

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

#8

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

#9

Updated by Benni Mack about 3 years ago

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

Updated by Benni Mack about 3 years ago

  • Status changed from Resolved to Closed
#11

Updated by Gerrit Code Review almost 3 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

#12

Updated by Benni Mack almost 3 years ago

  • Status changed from Under Review to Resolved
#13

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF