Bug #87970

Sites configuration module broken

Added by Joschi Kuphal 9 months ago. Updated 7 days ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
Link Handling, Site Handling & Routing
Start date:
2019-03-20
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When trying to add a new site configuration via the Sites module by clicking the button "Add new site configuration for this site", the following error occurs:

The argument "parameters" was registered with type "array", but is of type "string" in view helper "TYPO3\CMS\Fluid\ViewHelpers\Be\UriViewHelper".

The reason seems to be the wrongly escaped viewhelper argument parameters in /typo3/sysext/backend/Resources/Private/Templates/SiteConfiguration/Edit.html (see https://github.com/TYPO3/TYPO3.CMS/commit/0824e6e84b05d10fb431d9de308f37dbdce198b4#diff-3334d6ec7728df769c410043fd8ec672R3):

action="{f:be.uri(route:'site_configuration', parameters:{action: 'save'})}" 

Can be fixed by changing to:

action="{f:be.uri(route:'site_configuration', parameters:'{action: \'save\'}')}" 

typo3_error_report.png View (377 KB) Eugen Hollmann, 2019-04-30 11:01

typo3_error_access.png View (379 KB) Eugen Hollmann, 2019-04-30 11:01

typo3_error_sites.png View (404 KB) Eugen Hollmann, 2019-04-30 11:01


Related issues

Related to TYPO3 Core - Bug #88415: InvalidArgumentException in SiteConfiguration Needs Feedback 2019-05-22

Associated revisions

Revision af9d0674 (diff)
Added by Patrick Broens 13 days ago

[BUGFIX] Fix broken Fluid templates

In some versions of PHP there is a PCRE bug, which will be triggered when
using an unquoted array syntax in Fluid templates, leading to an error
and possibly not able to display the rendered template.

This is solved by using the quoted array syntax where it is not used yet.

Resolves: #87970
Releases: master, 9.5
Change-Id: I36f4ee86765fae24f7daa0e7e59ff9fc6741144f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62450
Reviewed-by: Rens Admiraal <>
Reviewed-by: Alexander Schnitzler <>
Reviewed-by: Claus Due <>
Reviewed-by: Benni Mack <>
Reviewed-by: Susanne Moog <>
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Tested-by: Susanne Moog <>

Revision f6a59136 (diff)
Added by Patrick Broens 7 days ago

[BUGFIX] Fix broken Fluid templates

In some versions of PHP there is a PCRE bug, which will be triggered when
using an unquoted array syntax in Fluid templates, leading to an error
and possibly not able to display the rendered template.

This is solved by using the quoted array syntax where it is not used yet.

Resolves: #87970
Releases: master, 9.5
Change-Id: I36f4ee86765fae24f7daa0e7e59ff9fc6741144f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62500
Tested-by: TYPO3com <>
Tested-by: Oliver Bartsch <>
Tested-by: Susanne Moog <>
Reviewed-by: Patrick Broens <>
Reviewed-by: Oliver Bartsch <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Susanne Moog <>

History

#1 Updated by Claus Due 9 months ago

I'm not sure if that unquoted array syntax ever worked (as first-level VH parameter value) but I'll check up on that at the parser level.

To solve this though, and because it definitely is more appropriate, we should switch to the quoted version Josci echoed above and avoid this unquoted usage.

PS: if expressions become nasty with quotes:

{f:be.uri(route="site_configuration" parameters="{action: 'save'}") -> f:variable(name: 'actionUrl')}
<form action="{actionUrl}">

...can be used to reduce the quoting. Two things are going on there: first, the inline VH expression uses tag mode arguments which is allowed in recent Fluid versions. Second, the output of the expression is stored in a variable that's much easier to handle esp. if you have to output it twice or use it in a condition.

#2 Updated by Sven Juergens 8 months ago

hi

is this a fix that can go in TYPO3 9.5.6 ?

#3 Updated by Frank Naegler 8 months ago

  • Status changed from New to Accepted
  • Assignee set to Frank Naegler

#4 Updated by Frank Naegler 8 months ago

  • Status changed from Accepted to Needs Feedback

Hello Joschi,
I tried to reproduce the problem, but for me, it works well without exception.
Can you please provide some more information about your system: PHP Version, OX version?
Also, a screenshot of the exception or log entries and a stack trace could be helpful.

#5 Updated by Eugen Hollmann 8 months ago

Hi there,

I have the same issues in TYPO3 9.5.5 with different BE-Modules, including:
  • Site management > Sites > Edit
  • System > Access
  • System > Reports

But it only occurs with PHP 7.3 (fcgi).
If I set "AddHandler php72-fcgi .php" in my .htaccess, everything is working fine.
But with "AddHandler php73-fcgi .php" I get the errors.

Fix by @Joschi Kuphal is working, but I prefered a downgrade to PHP 7.2 for now.

#6 Updated by Frank Naegler 8 months ago

@Eugen: Thanks for the screenshots and information.

@Claus: Is fluid ready for PHP 7.3 or could this be the problem?

@Joschi: you reported the issue for PHP 7.2 is this correct or is it only an issue with PHP 7.3?

#7 Updated by Patrick Broens 7 months ago

I can reproduce this on PHP 7.3.3 FPM/FastCGI on Linux NGINX. I've solved this for our own custom extensions, but the following modules are suffering with the problem:
  • Site configuration > Edit
  • Redirects
  • Template tools (page zero)
  • Backend Users (only once, then again after cache clearing)
  • Backend pagination widget

We only use the package typo3/minimal with some additional core packages, so there might be more as Eugen Hollman is mentioning, like Reports.

On Apache using the 7.3.3 Apache 2.0 Handler, I do not have the problem

#8 Updated by Nikolas Hagelstein 7 months ago

Confirmed on:

TYPO3 9.5.5
PHP 7.3.2
SAPI FPM

Does not happen on the same Site running php 7.3.3 on FPM

So might be an PHP issue, but i am not sure i did not compare every single PHP setting.

#9 Updated by Patrick Broens 7 months ago

  • PHP Version changed from 7.2 to 7.3

Unfortunately, in contrast to what Nikolas Hagelstein is mentioning, it does not work for us at PHP 7.3.3 fcgi

#10 Updated by Benni Mack 7 months ago

  • Target version changed from next-patchlevel to Candidate for patchlevel

#11 Updated by Benjamin Serfhos 6 months ago

+1.

Having the same problem. Occurred on fresh installation.

Local environment:

TYPO3 Version: 9.5.7
Webserver: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.6
PHP Version: 7.3.6
Application Context: Development
Composer mode: Enabled
Operating System: Linux 3.10.0-957.5.1.el7.x86_64

Fixed it locally by using :
action="{f:be.uri(route:'site_configuration', parameters:'{action: \'save\'}')}"

#12 Updated by Simon Köhler 6 months ago

I had this problem now with a 9.5.8 on Mittwald Servers:

TYPO3 Version 9.5.8
Webserver Apache
PHP Version 7.3.2
Database (Default) MySQL 5.7.25
Application Context Production
Operating System Linux 2.6.32-openvz-042stab127.2-amd64

Fixed with the above code, thanks!

#13 Updated by Guido Schmechel 5 months ago

  • Related to Bug #88415: InvalidArgumentException in SiteConfiguration added

#14 Updated by Guido Schmechel 5 months ago

Patch added in the related issue.

#15 Updated by Jan Greth 2 months ago

Can also confirm bug:

Operating system: Unix
PHP version: 7.3.8
PHP CGI detected: No
Database connection 'Default'
Version: MySQL 5.5.62

#16 Updated by Hugo Laporte 27 days ago

I also confirm.

UNIX
PHP 7.3.10
TYPO3 9.5.11

On Access page : PHP Warning: Cannot use a scalar value as an array in /www/typo3_src-9.5.11/typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php line 539

On Reports page : PHP Warning: array_merge(): Expected parameter 2 to be an array, string given in /www/typo3_src-9.5.11/typo3/sysext/backend/Classes/Routing/UriBuilder.php line 108

On BE Users page : The argument "arguments" was registered with type "array", but is of type "integer" in view helper "TYPO3\CMS\Fluid\ViewHelpers\Widget\UriViewHelper".

@Eugen Hollmann @Patrick Broens Did you find a solution regarding System>Access and System>Reports ?

#17 Updated by Jan Greth 21 days ago

And again the behaviour occurs:

OS Debian Buster
PHP Version 7.3.11
TYPO3 CMS 9.5.11 via Composer (Installation: composer require typo3/cms-about:^9.5 typo3/cms-adminpanel:^9.5 typo3/cms-backend:^9.5 typo3/cms-belog:^9.5 typo3/cms-beuser:^9.5 typo3/cms-core:^9.5 typo3/cms-extbase:^9.5 typo3/cms-extensionmanager:^9.5 typo3/cms-feedit:^9.5 typo3/cms-felogin:^9.5 typo3/cms-filelist:^9.5 typo3/cms-filemetadata:^9.5 typo3/cms-fluid:^9.5 typo3/cms-fluid-styled-content:^9.5 typo3/cms-form:^9.5 typo3/cms-frontend:^9.5 typo3/cms-impexp:^9.5 typo3/cms-info:^9.5 typo3/cms-install:^9.5 typo3/cms-linkvalidator:^9.5 typo3/cms-lowlevel:^9.5 typo3/cms-opendocs:^9.5 typo3/cms-recordlist:^9.5 typo3/cms-recycler:^9.5 typo3/cms-redirects:^9.5 typo3/cms-reports:^9.5 typo3/cms-rsaauth:^9.5 typo3/cms-rte-ckeditor:^9.5 typo3/cms-scheduler:^9.5 typo3/cms-seo:^9.5 typo3/cms-setup:^9.5 typo3/cms-sys-action:^9.5 typo3/cms-sys-note:^9.5 typo3/cms-t3editor:^9.5 typo3/cms-taskcenter:^9.5 typo3/cms-tstemplate:^9.5 typo3/cms-viewpage:^9.5 )

Added to TYPO3 CMS the Introduction Package: composer require typo3/cms-introduction:4.0.1

Sites Module => No default Site, so i click "Add new site configuration for this site"

Result:

Oops, an error occurred!
The argument "parameters" was registered with type "array", but is of type "string" in view helper "TYPO3\CMS\Fluid\ViewHelpers\Be\UriViewHelper".
More information regarding this error might be available online.

#18 Updated by Eugen Hollmann 21 days ago

@Hugo Laporte I downgraded to PHP 7.2, as this bug only occures on PHP 7.3.

#19 Updated by Hugo Laporte 17 days ago

Eugen Hollmann wrote:

@Hugo Laporte I downgraded to PHP 7.2, as this bug only occures on PHP 7.3.

I have a copy of my installation on another server which also run with php 7.3 and I don't see the error on the second one. I tried to compare both php.ini but I don't see anything that can leads to this.

#20 Updated by Farid Muradimov 15 days ago

+1

Problem only in PHP 7.3. Latest version including.
In PHP 7.2 all works fine.

PHP.ini is same.

Maybe language is changed...

#21 Updated by Gerrit Code Review 14 days ago

  • Status changed from Needs Feedback 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/+/62450

#22 Updated by Hugo Laporte 14 days ago

Gerrit Code Review wrote:

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/+/62450

WOW! Works like a charm! Thank you Patrick Broens!

#23 Updated by Patrick Broens 14 days ago

Hugo Laporte wrote:

Gerrit Code Review wrote:

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/+/62450

WOW! Works like a charm! Thank you Patrick Broens!

You're welcome.
If you have tested it, please add your vote, be it for code review or for testing so it can be merged soon.

#24 Updated by Gerrit Code Review 13 days 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/+/62500

#25 Updated by Patrick Broens 13 days ago

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

#26 Updated by Gerrit Code Review 9 days ago

  • Status changed from Resolved to Under Review

Patch set 2 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/+/62500

#27 Updated by Gerrit Code Review 9 days ago

Patch set 3 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/+/62500

#28 Updated by Gerrit Code Review 9 days ago

Patch set 4 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/+/62500

#29 Updated by Gerrit Code Review 9 days ago

Patch set 5 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/+/62500

#30 Updated by Patrick Broens 7 days ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF