- πΊπΈUnited States ja09
I'm getting this error with PHP 8.1, D 9.5, and field_states_ui 3.0.0.
#11 seems to resolve it. Thank you!
- Status changed to RTBC
about 1 year ago 1:01pm 7 November 2023 - πͺπΈSpain manuel garcia
Updating the title as this isn't just PHP 7.4.
Taking the leap here and moving to RTBC, it is being reported as valid, patch is small and looks good to me. Thank you @godotislate. - πΊπΈUnited States jvest
Tested patch #11 with v3.0.0 on Drupal core 10.2.11 and PHP 8.1.29 ... resolves warning messages.
- π©πͺGermany kopfduenger Wiesbaden
Patch #11 unfortunately did not worked for me anymore. I am on Drupal Version 10.3.10, PHP 8.1.30. Drupal log was flooded with messages as
Warning: Undefined array key "simple_sitemap" in Drupal\field_ui\Form\EntityDisplayFormBase->copyFormValuesToEntity() (Zeile 643 in /var/www/html/web/core/modules/field_ui/src/Form/EntityDisplayFormBase.php).
and
Warning: Trying to access array offset on value of type null in Drupal\field_ui\Form\EntityDisplayFormBase->copyFormValuesToEntity() (Zeile 643 in /var/www/html/web/core/modules/field_ui/src/Form/EntityDisplayFormBase.php).
Even worse, on my local installation, the fields on content types' form display page (admin/structure/types/manage//form-display) could not be edited anymore, showing more and more of these messages on top of the page, leading to:
*Drupal\Core\Database\DatabaseExceptionWrapper*: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT 1 AS "expression" FROM "sessions" "sessions" WHERE "sid" = :db_condition_placeholder_0; Array ( [:db_condition_placeholder_0] => bSH7ZZvbRVb_7-exNS2ItOFW-U3CvuFPPFamw54fVuM ) in *Drupal\Core\Session\SessionHandler->Drupal\Core\Session\{closure}()* (line *95* of */app/web/core/lib/Drupal/Core/Session/SessionHandler.php*)
This post directed me to the right solution: Stackoverflow β Message: Trying to access array offset on value of type null
The function copyFormValuesToEntity() in core/modules/field_ui/src/Form/EntityDisplayFormBase.php did not check for value NULL and existence of array value in two places. Previous versions of PHP may have been less strict on such mistakes and silently swallowed the error / notice.
Here is a patch β that works for in our drupal installation. Hope it helps.