Closed (fixed)
Project:
Reuse Cached 404s
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 May 2015 at 15:31 UTC
Updated:
31 Dec 2018 at 15:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
AlexKirienko commentedPlease check attached patch with fix.
Comment #2
eddie_c commentedThanks for the patch AlexKirienko. I've encountered what I believe is the same problem, although for me it just results in a blank 404 page being cached, not a fatal error.
Just to be clear about the problem which this patch addresses, here's what I believe to be happening:
- drupal_page_set_cache() returns NULL if the page can't be cached. As you mention, this is because a message may be set on the page.
- In reuse_cached_404_page_set_cache(), this results in $cache being NULL.
- However, we still proceed to use $cache to set the 'reuse_cached_404' cache of the 404 page
- This results in a blank 404 page in the cache, which is then retrieved for all subsequent 404 pages.
Comment #3
eddie_c commentedI've tested the patch in #1 and it fixes the problem I've described in #2: If the 404 page is not cacheable, this patch prevents a blank 404 page from getting cached by the module.
Comment #5
liam morlandThanks!