Hi there,
First off, thanks for such a fantastic module! It works absolutely beautifully.
The only problem I've seen is that when you first enable the module, everything works perfectly... However when you then go and save the form for core 403/404 handling (/admin/settings/error-reporting) the variable 'site_404' gets overridden in the database. This obviously causes the module to not run when going to content that doesn't exist (i.e. you simply get default behaviour now).
A possible fix would be setting the 'site_404' variable when the Search404 admin page form is submitted (as it seems to be currently done for core)... This way it would re-instate the 'site_404' variable. Then if a user wants to utilise the module, they'd save this modules form AFTER saving the core form... Basically whichever is saved last will determine which method is used for a 404 error page.
I am happy to create a patch to set this variable if you'd like? It'd be simply one line of code that would be: variable_set('site_404', 'search404);
Will this be adopted? Are there any implications?
Cheers :)
Comments
Comment #1
zyxware commentedThanks for the bug report and the suggestion of the solution marc.groth.
I created a hidden field in the administration form that will reset the site_404 variable whenever the search404 settings are saved. This should resolve the issue you have raised.
I have committed the changes to the dev of search404
Regards
Santhosh Raju
Comment #2
marc.groth commentedThanks very much Santhosh,
I will download and test it as soon as I can. It sounds like it will work though, so thanks for implementing the fix.
Cheers,
Marc
Comment #3
marc.groth commentedSorry it's taken a while to respond further but I have managed to test this and it works.
Thanks again,
Marc
Comment #4
ajaypr commentedI recently removed few features like gallery images from my site http://www.ajaypr.com . Now I am getting lot of 404 from bots which is consuming lot of bandwidth and my server is exceeding max sql connections. How can I disable the drupal 404 page handling and set a specific html page as 404 page?
Comment #5
ferrangil commentedEasy. You do not need this module for that. Simply go to admin/settings/error-reporting and specify a page for 404 errors (you probably want a static html page, to avoid extra queries).
Comment #6
zyxware commentedMarking issue as fixed.
Comment #8
adamus_maximus commentedEverytime you make any config changes to Search404, it quitely specifies Search404 in the Error Reporting page... even if it has to overwrite an existing custom value.
Your assuption is that if I'm using the search404 module, then I want all 404's to redirect to search404. This is a problem for me, because I have site_404 set to "customerror/404". In the customerror module, I run some additional logic before deciding to redirect to the search404 page, using drupal_goto()
I suggest that the code be changed, such that the existing value of site_404 is examined, and a decison is made whether or not to overwrite it. If it appears that the value was overwritten by core, then sure, search404 can go ahead and re-overwrite it. But if it contains some unrecognized string, leave it alone.
Comment #9
zyxware commented@adamus_maximus - How would search404 know whether the site_404 was modified by core vs modified by another module? I could take out the automatic resetting option and instead give a status message in the admin/reports/status page if that makes more sense. @marc.groth - what do you think?
Comment #10
zyxware commented