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

Drupal version: 7.x

Comments

jbloomfield’s picture

Status: Needs review » Needs work

Hi 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.

PawelR’s picture

Please 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.

PawelR’s picture

Issue summary: View changes

change display

xylustc’s picture

Hi jblookfield,

I modified the code, and had it checked by coder module.
Please review it again.
Thank you.

xylustc’s picture

Hi 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.

jbloomfield’s picture

Automatic Review

Found 1 error using PAReview at http://ventral.org/pareview/httpgitdrupalorgsandboxxylustc1881890git

Manual Review

  • You create an alter called "te_node_order_right" on Line 838 of the .module file. Would this be better to name it the same as your module e.g taxonomy_extends_node_order_right() ?

Other than the above, I didn't find any major issues.

xylustc’s picture

Status: Needs work » Needs review

Issues 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.

jbloomfield’s picture

Status: Needs review » Needs work
xylustc’s picture

Status: Needs work » Needs review

Done.

I lost a full stop in comment, and the coder module didn't check it out, but pareview.sh checked it out.

Thank you.

jbloomfield’s picture

Hi,

All good for errors on ventral.org and everything else looks fine to me now.

Cheers.

klausi’s picture

We 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 :-)

denisz’s picture

Status: Needs review » Needs work

Hi, 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.

xylustc’s picture

Assigned: Unassigned » xylustc
Status: Needs work » Needs review

1. 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.

izus’s picture

Status: Needs review » Needs work

Hi,

Good module, thanks for contribution !
Here is my review of it :

- in taxonomy_extends_tokens you 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] = $cascadename will 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 ?

 $nid = @$values["nid"];
 $tid = @$values["tid"];
 $sticky_pos = @$values["sticky_pos"];
 $node_pos = @$values["node_pos"];
 $sticky_pos_old = @$values['sticky_pos_old'];
 $node_pos_old = @$values['node_pos_old'];

- 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

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing 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.

xylustc’s picture

Status: Closed (won't fix) » Needs review

All these issues be done.
thanks.

kscheirer’s picture

Title: Taxonomy Extends » [D7] Taxonomy Extends
Assigned: xylustc » Unassigned

The 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_extends you 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.

kscheirer’s picture

Status: Needs review » Needs work

You 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.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing 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.

PA robot’s picture

Issue summary: View changes

change to branch 7.x-1.x-dev