0
Welcome Guest! Login
0 items Join Now

PHP Fatal Error upon Gantry 1.28 upgrade

  • PHP Fatal Error upon Gantry 1.28 upgrade

    Posted 12 years 5 months ago
    • Hi,
      I updated to 1.28 today and my site completely crashed.

      The php log showed this:
      Fatal error: Call to a member function isEnabled() on a non-object in /public_html/wordpress/wp-content/plugins/gantry/core/gantry.class.php on line 753

      So I commented those few lines out:
         function displayHead() {
              if (defined('GANTRY_FINALIZED')) return;
              foreach($this->_gizmos as $gizmo){
                  $gizmo_instance = $this->_getGizmo($gizmo);
         //         if ($gizmo_instance->isEnabled() && method_exists( $gizmo_instance , 'render')) {
         //             $gizmo_instance->render();
         //         }
              }
       
              do_action( 'get_header', null );
              
              echo "<gantry:header/>";
          }
       

      Which solved the error, but I wanted to point this out for the developers and to help anyone who runs into a similar problem.
    • Shazdeh's Avatar
    • Shazdeh
    • Elite Rocketeer
    • Posts: 4984
    • Thanks: 29

    Re: PHP Fatal Error upon Gantry 1.28 upgrade

    Posted 12 years 5 months ago
    • Hi,
      that part of the code calls the render method for gizmos. As a temproray fix, replace it with this:
          function displayHead() {
                if (defined('GANTRY_FINALIZED')) return;
                foreach($this->_gizmos as $gizmo){
                     $gizmo_instance = $this->_getGizmo($gizmo);
                     if (method_exists( $gizmo_instance, 'isEnabled' ) && $gizmo_instance->isEnabled() && method_exists( $gizmo_instance , 'render')) {
                          $gizmo_instance->render();
                     }
                }
       
                do_action( 'get_header', null );
               
                echo "<gantry:header/>";
           }
      Thank you for reporting the issue, we'll update the plugin to fix it.
    • Please don't PM unless requested ;)
      Consider using the custom stylesheet for all your CSS customizations: gantry-framework.org/documentation/wordp...custom_stylesheet.md .
      Please provide the URL to the issue.
      And please mark the thread as solved if the issue is resolved.
  • Re: PHP Fatal Error upon Gantry 1.28 upgrade

    Posted 12 years 5 months ago
    • That seems to have fixed the problem.

      Thanks!

Time to create page: 0.058 seconds