Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
1 Sep 2011 at 10:02 UTC
Updated:
7 Jun 2013 at 20:20 UTC
This module is built to avoid 404 (page not found) error. This is done by automatically redirecting to the page with the most similar alias, compared to the one entered via URL.
http://drupal.org/sandbox/hardcoding/1266394
git clone http://git.drupal.org/sandbox/hardcoding/1266394.git avoid404
Tested on Drupal 7.7
Manual reviews of other projects:
Comments
Comment #1
hardcoding commentedComment #2
hardcoding commentedjust solved the conflicts with the locale module, if enabled
Comment #3
pillarsdotnet commentedinteresting approach. I'm tempted to install it on my website just to see how long it takes to respond to a 404, on a site with *lots* of path aliases.
Comment #4
pillarsdotnet commentedYou need a README.txt file, especially if there is anything that needs to be done for installation other than visiting the modules page.
You need to delete the .svn directory from the git repository.
Dunno if it's possible with a sandbox, but your branch should be "7.x-1.x" rather than "master".
You need to run everything through Coder review if you haven't already.
Consider renaming your files/functions to "avoid404" instead of "avoid_404" (i.e. lose the underscore) This is a suggestion not a requirement. Even if someone created a module called "avoid", I doubt we'll ever have any hooks called "404" so probably there's no possibility of namespace clashing.
You need an
avoid_404.install(oravoid404.install) file to delete your module-specific variables when your module gets uninstalled. Seehook_uninstall().Probably you should consider integrating with the Redirect module. (This is another suggestion.)
I'd be curious to know what "hoechste" means in English.
Yup; I can see you have not run Coder review, because you have trailing spaces.
The
avoid_404_getRedirectAlias()function should be renamed toavoid_404_get_redirect_alias(). Drupal coding standards reserves the use of MixedUpperAndLowerCase for class and method names. Ordinary functions should use the underscore as a word delimiter.Your files have DOS line endings. You need to convert them to Unix line endings, or else coder will spit out some really confusing error messages.
Remove the
; $Id$and theversion = 0.1lines from youravoid_404.infofile.(attempting to actually install and test the module now...)
It would be nice (another suggestion) if there was a "select all" option under "Menus to be considered".
(trying to visit a nonexistent page...)
Yup; your module definitely conflicts with the Redirect module.
(Temporarily disabling the latter for testing.)
Okay, I have a page at http://pillars.net/lyrics/rejoice
I tried to visit http://pillars.net/lyrics/rejoiced
But I got a 404 "Page not found" instead.
So... needs work. Too bad, because I'd really like to test things out on a real website.
So it would appear that your module has other conflicts with my site, as well.
Comment #5
hardcoding commentedthanks for your effort. i will take a look at the module again when i have some spare time.
i find your idea interesting to integrate this module into the redirect module. should not be too difficult and would avoid the conflict.
Comment #6
misc commentedThe applicant has been contacted to ask if the application is abandoned.
http://drupal.org/node/894256
Comment #7
misc commentedThe application has been closed. If you would like to reopen it, you are free to do so.
See http://drupal.org/node/894256#abandonedtwoweekscontact
Comment #8
hardcoding commentedsorry for not responding to your enuqiry. i have this project in mind, but unfortunately i have had no spare time over the past few weeks/months. thank you for beeing after this anyway..
Comment #9
hardcoding commentedfixed the problems from #4
hope someone feel free for testing
Comment #10
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxhardcoding1266394git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #11
hardcoding commentedcorrected errors which code sniffer found
Comment #12
hardcoding commentedchanged title
Comment #13
eriknewby commented2 minor code change suggestions in avoid404.module:
(return substr(preg_replace('/' . trim($language->prefix) . '/', "", $path, 1), 1);)
Comment #14
hardcoding commentedthanks for that.
i changed the code in these lines.
drupal_substr makes sense for me because of the unknown url.
Comment #15
thomas_rendleman commentedTested D7.22
Looks good.
Code looks good.
The only thing I would add is in the README.txt because currently there is no text in that file.
Comment #16
hardcoding commentedThank you for testing. :)
I filled the README.txt with text. Hope this was the last change.
Comment #17
musicalvegan0 commentedWhen I installed the module, I was not able to access the configuration page even though I am in the administrator role. You should implement hook_permission() so the permissions for this module are assignable to users and roles.
Otherwise, the rest of the code looks good to me. Good job!
Comment #18
hardcoding commentedHi musicalvegan0,
first of all thank you. i reproduced the bug. there was a remainder in my code. So only user 1 had access.
I implemented your feature request, so now you can give permission for each user role to access the administration page of avoid404.
Comment #19
musicalvegan0 commentedLooks good! As far as I can tell, all you need to do now is participate in the Review Bonus program. Good luck.
Comment #19.0
musicalvegan0 commentedchanged git url
Comment #20
hardcoding commentedadded "PAReview: review bonus" tag
Comment #20.0
hardcoding commentedReviews of other projects
Comment #21
a.milkovskyI can suggest you can remove "[D7]" from module name at http://drupal.org/sandbox/hardcoding/1266394.
D7 prefix in title is neccessary only in issues queue for project applications
Comment #22
hardcoding commentedyou are right, i changed it. thanks :)
Comment #23
kriboogh commentedJust tested this and works as stated. Nice, i think this module can really enhance the user experience.
Maybe a small optimisation would be to try to put all functions not needed directly in a separate file which you include only when going to do avoid404 specific stuff. I think from hook_init you only need 'avoid404_page_exists' -> 'avoid404_build_path' -> 'avoid404_get_active_languages'.
Then in your true condition, include the extra functions to do avoid404_goto
How about a hook to let other modules add their own list of extra aliases. Just a thought.
regards,
Comment #24
hardcoding commentedHi kriboogh,
thanks for your suggestions. I created 2 new files. avoid404.inc and avoid404.api.php.
You wrote a good point. I added an hook to let other modules add their aliases.
Hope this was the last optimisation. :)
Comment #25
mpv commentedHave you looked into Search 404? I think the functionality of your module can be replicated by it, since it has options to show the first search result instead of the results page when a 404 is reached. I haven't really tested yours, so I might be wrong.
You should ensure your project is not a duplication as suggested in the project application checklist, and please if it is not a duplication add a comment in your project page explaining the differences between both modules.
Comment #26
hardcoding commentedHi mpv,
thanks for your search. I updated my project page.
Here an explanation of the difference between these 2 modules:
Search 404 performs a search on the keywords in the URL, e.g. if a user goes to http://example.com/does/not/exist, this module will do a search for "does not exist" and shows the result of the search instead of the 404 page. Search 404 performs the search in the content.
Avoid 404 performs a search on the alias in the URL, if a user goes to http://example.com/mynode1 and the alias "mynode1" is not set but "mynode" is set, this module will redirect to this most similar alias.
Comment #26.0
hardcoding commentedReviews of other projects
Comment #27
klausimanual review:
But that are not critical application blockers, so I guess this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to Dave Reid as he might have time to take a final look at this.
Comment #28
klausino objections for more than a week, so ...
Thanks for your contribution, hardcoding!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #29.0
(not verified) commentedremoved automated review copies