Fixed PHP error on page requests while upgrade to XenForo 2.1 is running

Steffen

Well-known member
Affected version
2.1 RC1
Code:
ErrorException {▼
  #message: "[E_NOTICE] Undefined index: enablePush"
  #code: 0
  #file: "src/XF.php"
  #line: 566
  #severity: E_NOTICE
  trace: {▶}
}

This PHP error triggers the XF\Error::displayFatalExceptionMessage error path (which just outputs a "site_currently_being_upgraded" phrase on an otherwise empty page) instead of showing a more user-friendly error page.

Possible fix:
Diff:
--- a/src/XF.php
+++ b/src/XF.php
@@ -562,7 +562,9 @@ class XF
      */
     public static function isPushUsable()
     {
-        if (!self::options()->enablePush)
+        $options = self::options();
+
+        if (!isset($options->enablePush) || !$options->enablePush)
         {
             return false;
         }
 
Last edited:
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.0 RC2).

Change log:
Prevent a fatal error in the interim between uploading the 2.1 files and upgrading related to the enablePush option and the enable push notifications notice.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top Bottom