This module provides some extends for core taxonomy module.
Token "term:hierarchypath":
This is a token, generates hierarchy path like voculaburyname/roottermname/nextleveltermname/...
For a voculabury named Music, terms like:
--ChineseMusic
----ClassicalMusic
----POPMusic
--EnglishMusic
The token for term "ChineseMusic" is "Music/ChineseMusic", and token for term "ClassicalMusic" is "Music/ChineseMusic/ClassicalMusic"
This is useful for pathauto module to generate path alias for term.
node order functionality:
Order nodes under a term. New nodes appears in the top, you can drag and drop to order nodes manually, rearrange sticky orders.
Visit nodes list at "voculaburyname/roottermname/nextleveltermname/.../list".
After enabled this module, you can find a menu named "taxonomy extends", it is the first page of this module. In this page, you can
do most task of this module.
The table node_term_order (tid,nid,node_order,sticky_order) stores the order data. Order Rule: sticky_order desc, node_order desc
Project page:
http://drupal.org/sandbox/xylustc/1881890
Git repo:
git clone --recursive --branch 7.x-1.x-dev xylustc@git.drupal.org:sandbox/xylustc/1881890.git taxonomy_extends
Comments
Comment #1
jbloomfield commentedHi xylustc,
Ran the code through the online coder check and there are some formatting issues, please see http://ventral.org/pareview/httpgitdrupalorgsandboxxylustc1881890git
Once you have sorted the issues out I will review again.
Comment #2
PawelR commentedPlease move your code to version branch and delete master branch - http://drupal.org/empty-git-master.
There should also be hook_uninstall implement where you should delete variable(s) your module creates.
Comment #2.0
PawelR commentedchange display
Comment #3
xylustc commentedHi jblookfield,
I modified the code, and had it checked by coder module.
Please review it again.
Thank you.
Comment #4
xylustc commentedHi PawelR,
I created a branch 7.x-1.x-dev, and changed to this branch.
I also implemented hook_uninstall, and deleted the variable when uninstall.
Thank you.
Comment #5
jbloomfield commentedAutomatic Review
Found 1 error using PAReview at http://ventral.org/pareview/httpgitdrupalorgsandboxxylustc1881890git
Manual Review
Other than the above, I didn't find any major issues.
Comment #6
xylustc commentedIssues worked out.
I changed "te_node_order_right" to "taxonomy_extends_node_order_right, and some other issue caused by php version in the code. And I have the code tested again.
Thank you.
Comment #7
jbloomfield commentedSorry, still get an error on http://ventral.org/pareview/httpgitdrupalorgsandboxxylustc1881890git
Comment #8
xylustc commentedDone.
I lost a full stop in comment, and the coder module didn't check it out, but pareview.sh checked it out.
Thank you.
Comment #9
jbloomfield commentedHi,
All good for errors on ventral.org and everything else looks fine to me now.
Cheers.
Comment #10
klausiWe are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #11
denisz commentedHi, xylustc.
Manual review:
1 You have multiple places where static text not wrapped in t() function.
2 README.txt have not wright structure. See example here http://drupal.org/node/1271064.
3 Looks like path 'admin/taxonomy_extends' is main admin panel of this module, but in not appear in Management menu, you must specify it on your hook_menu. Also you not specified any permission and it not clear who can manage this settings.
Please fix all this issues.
Comment #12
xylustc commented1. Checked the static text, and wrapped them in t() funciton. Menu titles and descriptaions are not allowed be wrapped in t() funciton, so left them there.
2. README.txt was rearranged.
3. I checked the path "admin/taxonomy_extends" , it was in Management menu, and the permissions are specified in hook_menu function, by "access callback" and "access argumensts" items. Also four apis for other modules change the permissions.
Thanks.
Comment #13
izus commentedHi,
Good module, thanks for contribution !
Here is my review of it :
- in
taxonomy_extends_tokensyou are foreaching all tokens to get only the 'hierarchypath' one ! I think its better to access the information you need simply by accessing the 'hierarchypath' key (if(isset($tokens['hierarchypath'])) {//do stuff}). this will avoid unecessary $tokens looping.-
$replacements[$original] = $sanitize ? ($cascadename) : ($cascadename);i didn't understand why we are testing $sanitize here and having the same value anyway.
$replacements[$original] = $cascadenamewill be clear i guess- it's a commun Drupal best practice to use the
l()function to generate links instead of all those hard coded'<a href='*, please try to use l().- For performance concerns, it's a good practice in Drupal to move all the form declaration and handler to a separate file. so that the .module remains clean with minimal needed code.
i suggest to move like this :
Whenever you have a menu item that has a
'page callback' => 'drupal_get_form',you can add a'file' => 'taxonomy_extends.forms.inc'and move the formbuilder and handlers from the .module to the .forms.inc- You can use
theme('table', $variables)instead of the hard coded'<table><tr><th>'*- are all those '@' really necessary ?
- For performance needs an dbest practices, i suggest to add only a hook_views_api in your .module and move the hook_views_data to a taxonomy_extends.views.inc for example
Comment #14
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #15
xylustc commentedAll these issues be done.
thanks.
Comment #16
kscheirerThe name of your module is not very descriptive, and it depends on tokens, how about something like "Taxonomy Token Extension" or "More Taxonomy Tokens" instead?
In your README, name should be a human-readable string like "Taxonomy Extends". The same applies to the description, and you can remove the commented lines.
You don't need taxonomy_extends_install() if it's just to set a default value. And use single quotes unless you need variable substitution.
For
admin/config/system/taxonomy_extendsyou have no access arguments - I think it will still inherit from the parent menu item, but you might want to be sure.Just a partial review.
----
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #17
kscheirerYou have some misspellings - "voculaburyname" should be "vocabularyname". Your branch should be named "7.x-1.x" instead of "7.x-1.x-dev".
In taxonomy_extends_term_list() you have
drupal_set_title($term->name);which is a security risk - please use check_plain() before outputting the tern name.I'm not really sure what this module does, but the code looks ok. Setting to "needs work" for the security problem, otherwise this looks RTBC. Some more documentation or examples of what the module does would be muchly appreciated.
----
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #18
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #18.0
PA robot commentedchange to branch 7.x-1.x-dev