Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drupal8::isMaintenceMode() - Don't crash on new/clean sites
In E2E\AfformMock\MockPublicFormTest, it attempts to submit form as an anonymous user. On a new/clean instance of D9/D10 with php83, the test fails consistently. BEFORE: The submission is rejected. In the Drupal log, we see a corresponding error: TypeError: CRM_Utils_System_Drupal8::isMaintenanceMode(): Return value must be of type bool, null returned in CRM_Utils_System_Drupal8->isMaintenanceMode() (line 1023 of /home/totten/bknix/build/build-0/src/civicrm-core/CRM/Utils/System/Drupal8.php). - #0 /home/totten/bknix/build/build-0/src/civicrm-core/CRM/Utils/System.php(1952): CRM_Utils_System_Drupal8->isMaintenanceMode() - #1 /home/totten/bknix/build/build-0/src/civicrm-core/CRM/Api4/Page/AJAX.php(28): CRM_Utils_System::isMaintenanceMode() - #2 /home/totten/bknix/build/build-0/src/civicrm-core/CRM/Core/Invoke.php(278): CRM_Api4_Page_AJAX->run(Array, NULL) - #3 /home/totten/bknix/build/build-0/src/civicrm-core/CRM/Core/Invoke.php(73): CRM_Core_Invoke::runItem(Array) AFTER: It's ok. TECHNICAL DETAILS: On a new/clean system, the content of `system.maintenance_mode` appears to be `NULL`. The bug is likely hard to see in manual testing because: 1. A lot of manual testing is done as admin user (who can bypass maintence-mode checks). 2. After you've toggled maintenance-mode for the first, the value becomes `0` or `1`.
- Loading branch information