Module name
Alias Hierarchy
Sandbox link
http://drupal.org/sandbox/djac/1331114
Git Repository
git clone --branch 6.x-1.x http://git.drupal.org/sandbox/djac/1331114.git alias_hierarchy
Drupal core
6.x
Notes
- Although the initial commit to git is recent, this module has been used in a production environment since December 2010.
- Versioned as beta1 because ideally, we would use a custom token defined by the module. I ran into issues when trying to implement the token, so this remains as a to-do.
Description
Alias Hierarchy regenerates a node's URL/path alias and then recursively updates any children nodes. The module is also triggered when changes are made to menu items.
The Alias Hierarchy module makes use of the Pathauto module and extends its functionality. The idea behind the module is that we want node aliases to match the menu system's structure. This can be accomplished with Pathauto alone, however, there are scenarios where aliases do not get updated correctly to match changes made to a node.
Alias Hierarchy addresses those scenarios by implementing the following:
1) regenerate a node's alias if the node is moved in the menu system.
2) regenerate children aliases after editing a node or moving a node in the menu system.
3) allow for a 'custom alias' field, where users are able to change the last string in a node's alias.
The alias will be generated first using the custom alias. If it is blank, the menu title will be used. If that is blank, the node title is used as a default.
Comments
Comment #1
chakrapani commentedIt appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Comment #2
djac commentedThanks chakrapani. I moved the code into the 6.x-1.x branch and applied the fixes that you outlined above.
Comment #3
patrickd commentedSee http://ventral.org/pareview/httpgitdrupalorgsandboxdjac1331114git
Comment #4
djac commentedThe only remaining 2 warnings are asking that I add & before variable names in @param documentation. I've skipped removing the & after seeing recent Drupal 8 core code where the & is being removed.
Comment #5
jthorson commentedFor the most part, things look pretty good.
My only concern would be with the possibility of XSS attacks ... the most likely culprit being inside of alias_hierarchy_form_alter:
In this case, I'm not sure you can fully trust the drupal_get_path_alias() function to return 'safe' text; as the alias may be user-supplied, and Drupal's common pattern is to sanitize on output instead of input.
It felt like you may have been missing more check_plain() calls, but I'm assuming that pathauto_cleanstring() takes care of sanitization.
Other than that ... toss a sanitization function around $parent_alias (or explain why it isn't needed), and this is pretty much ready for an RTBC status.
Thanks for your patience, and sorry for the wait!
Comment #6
jthorson commentedOkay ... being a textfield, the above should be okay.
Let's pass this on to the Git Admins. :)
Comment #7
klausiLooks great.
Thanks for your contribution, djac! Welcome to the community of project contributors on drupal.org.
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
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.
As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.
Comment #8.0
(not verified) commentedSpecify branch in git clone command.