Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Fatal error: Call to a member function expire() on a non-object in /site_root/sites/all/modules/contrib/expire/expire.module on line 253
Comment | File | Size | Author |
---|---|---|---|
#3 | 2337057-handler-not-found-trigger-error.patch | 1.04 KB | Dave Reid |
#1 | expire-fatal_error_when_no_handler-2337057-1.patch | 733 bytes | petermallett |
Comments
Comment #1
petermallett CreditAttribution: petermallett commentedI don't know at this time what the value for $type was that is causing _expire_get_expiration_handler to return FALSE, but in any case, we cannot call a method on FALSE, so I have added a check for the return value in expire_execute_expiration.
Comment #2
SpleshkaAs far as I remember, it was designed exactly to get this error. If you use module's functionality out of the box you won't see this error, because all handlers are pre-defined. If you want to use your own handlers and you set them up wrong, then i would prefer to display this error to indicate that class wasn't actually loaded, then just a silent exception handling.
Comment #3
Dave ReidHowever, the current way stops all execution on the current request. It would be nice if we logged the error instead of stopping execution since this isn't something that should bring down a site if it's not working properly.
Comment #5
SpleshkaOkay, I see you point. I really can't say which way I would prefer better - keep existing behavior or make it not that hard, for me both is okay. So if you guys think the new behavior is better, then I don't see any problems in taking your side. Thanks for your patches!