- π¦πΊAustralia CBEEM
This is an issue for me on a production site, Drupal on cPanel on a remote Internet host so I do not have much access to settings etc.
Drupal 9.3, 9.4 or 9.5 all produce the error when trying to add a new user:
Error: Unsupported operand types in Drupal\Core\Render\Element::children() (line 93 of core\lib\Drupal\Core\Render\Element.php)On PHP 7.4 everything is fine, but any flavour of PHP 8 produces the error.
On my local setup (Drupal 9.3 - 9.5) (PHP 8.0 - 8.1.16) everything works fine.
Also I do not have the issue on Drupal 9.5 on other remote hosts (also PHP 8.1.16).
For the affected site there are some customisations on my login form, but this does not produce any issues on my local copy with PHP 8.1.13 or 8.1.16. The customisations use a Profile form from the Profile module, I only have one profile set up which provides a few items to agree to before clicking a checkbox to proceed. This is set to display on the registration form. This has worked just fine for years in every update of Drupal and works on my local setup.
Might there be some issue in the Profile module? Or something to do with core?
Any insight would be appreciated, I am unable to update the Drupal site without PHP 8.
Thanks :)
- π¦πΊAustralia CBEEM
Got this working. I have no idea why it is only this host that is affected, but for this particular host an edit to core fixed the issue:
Drupal 9.5.4
/web/core/lib/Drupal/Core/Render/element.php
Line 93:
Change: "$child_weights[$key] = floor($weight * 1000) + $i / $count;"
to: $child_weights[$key] = floor((int)$weight * 1000) + $i / $count;The user registration form is now functioning again and errors are no longer appearing in the logs.
The Drupal database is updating OK and all looks good.
I do not particularly want to be editing core every time I update this sight. I wonder if anyone has some insight into why this might be happening just for this host? Maybe something not installed in PHP on the server?
Cheers
- πΊπΈUnited States ethomas08 SF Bay Area
Used comment 10 feedback to create rerolled patch for the 7.102 drupal core release.