Provide a status field for taxonomy terms analogous to the status field on nodes. This project provides an option in terms edit form to enable/disable taxonomy terms instead of deleting extra vocabulary terms. This module provides basic getter, setter function to get the status of a term or update any term's status.

Sandbox Project Page link: http://drupal.org/sandbox/asimfastian/1179898

CommentFileSizeAuthor
#26 tem_status_1.PNG8.99 KBteyser
#5 coder-review.pdf124.26 KBpatrickd

Comments

asimfastian’s picture

Priority: Major » Normal
asimfastian’s picture

Priority: Normal » Major
asimfastian’s picture

Priority: Major » Critical
patrickd’s picture

Status: Needs review » Needs work

Please do not push into the master branch, follow the instructions on naming conventions here:
http://drupal.org/node/1015226, git branching: http://drupal.org/node/1066342

Most of the other issues can be detected by the coder module (http://drupal.org/project/coder)

Also a README.txt is missing, check other projects about how to write them.

regards

patrickd’s picture

StatusFileSize
new124.26 KB

oh sorry - wrong project :/

asimfastian’s picture

Status: Needs work » Needs review

I believe previous feedback was not for this module.

patrickd’s picture

Status: Needs review » Needs work

It was just the pdf which was wrong. Sorry for that.

But the Issues of #4 have not been fixed yet.

asimfastian’s picture

Status: Needs work » Needs review

I have added a README File and committed the code and changes to a new remote branch.

patrickd’s picture

Status: Needs review » Needs work

still some fundamental issues:

It appears you are not working correctly with branches 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.

There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732
Review of the 6.x-1.0 branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.

asimfastian’s picture

Status: Needs work » Needs review

Thank you for pointing out git issues. Actually I'm new to git and still its initial learning stages.

I have removed old CSV $Id tag from all files. I also deleted master branch as per listed in point#5.

asifnoor’s picture

Status: Needs review » Needs work

Did a quick review of the module and here are my notes.

1. In the info file, please add the version of the core, package name and description
2. In the module file, run the coder and make the code indented.
3. Your module is not compatible with 6.22 version. let us know which version of drupal i need to have to get this working. i have checked it out both 6.x-1.x and 7.x-1.x both are not working in either d6 or d7.
4. README file is missing still. Not sure what your module does. I did not understand the functionality of this module. Please add the use of this module in README file.

Coder Review

term_status.module
Line 13: Potential problem: FAPI elements '#title' and '#description' only accept filtered text, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized.
$form['term_status'] = array('#type' => 'checkbox', '#title' => t('Enable this term.'), '#weight' => 1, '#default_value' => $default_term_status);
Line 25: use a space between the closing parenthesis and the open bracket
function term_status_form_submit($form, &$form_state){
Line 27: missing space after comma
term_status_set($form_state['values']['tid'],$form_state['values']['term_status']);
Line 34: use a space between the closing parenthesis and the open bracket
function term_status_get($tid=0){
Line 35: Control statements should have one space between the control keyword and opening parenthesis
if($tid>0){
Line 35: use a space between the closing parenthesis and the open bracket
if($tid>0){
Line 36: missing space after comma
$result = db_fetch_object(db_query('select tid,status from {term_status} where tid=%d',$tid));
Line 37: Control statements should have one space between the control keyword and opening parenthesis
if($result->tid){
Line 37: use a space between the closing parenthesis and the open bracket
if($result->tid){
Line 47: use a space between the closing parenthesis and the open bracket
function term_status_set($tid=0,$status=1){
Line 47: missing space after comma
function term_status_set($tid=0,$status=1){
Line 48: Control statements should have one space between the control keyword and opening parenthesis
if($tid>0){
Line 48: use a space between the closing parenthesis and the open bracket
if($tid>0){
Line 49: missing space after comma
$result = db_fetch_object(db_query('select count(*) as count from {term_status} where tid=%d',$tid));
Line 50: Control statements should have one space between the control keyword and opening parenthesis
if($result->count > 0){
Line 50: use a space between the closing parenthesis and the open bracket
if($result->count > 0){
Line 51: missing space after comma
$result = db_query('UPDATE {term_status} SET status=%d where tid=%d',$status,$tid);
Line 54: missing space after comma
$result = db_query('INSERT INTO {term_status} (tid,status) VALUES (%d, %d)',$tid,$status);

sites/all/modules/custom/term_status/term_status.install
term_status.install
Line -1: @file block missing (Drupal Docs)
Line 40: missing space after comma
'tid_status' => array('tid','status'),

klausi’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.

asimfastian’s picture

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

could not work on it due to some personal reasons. Now I am back. Please review and approve it. thanks.

asimfastian’s picture

Issue summary: View changes

updated the description and added the project link in description.

PA robot’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 put yourself on the PAReview: review bonus high priority list. Then I'll take a look at your project right away :-)

I'm a robot and this is an automated message from Project Applications Scraper.

veeraprasadd’s picture

Hi asimfastian,

Reviewed your module and found issues in automated project review in ventral.org
---
And in manual review:

File: term_status.module
Line 6: Use hook_form_FORM_ID_alter() instead hook_form_alter() to avoid $form_id check in Line 7.

Thanks and Regards,
D. Veera Prasad.
www.drup-all.com

jibran’s picture

Status: Needs review » Needs work

As per #11

jibran’s picture

Priority: Critical » Normal

http://ventral.org/pareview/httpgitdrupalorgsandboxasimfastian1179898git has some issues too. Reverting to normal because it is back to NW.

asimfastian’s picture

Priority: Normal » Critical
Status: Needs work » Needs review

Mentioned changes have been implemented.

patrickd’s picture

Status: Needs review » Postponed

Your project page is not very detailed, please have a look at the tips for a great project page, you may also use HTML-tags for better structure.

A general best practice: Never use 0's or 1es as constants - if you have static values define a constant with a proper name to improve code readability.
eg. define('TERM_STATUS_ENABLED', 1)

term_status_get($tid = 0) {
  if ($tid > 0) {
.....
function term_status_set($tid = 0, $status = 1) {
  if ($tid > 0) {
.....

why do you set a default value for $tid if you don't handle it? that makes no sense to me

Beside all that, this project is too short to make a serious review. We are currently discussing how much code we need, but with such a few lines of code we are not able to determine whether you can make use of drupal's API's in a correct and secure way.

I'd suggest that you provide an Drupal 7 version of this project, which should give us enough to make sure you know what your doing (I'm not saying you don't - but how should I know). If you don't like to do that I can approve this single project. That means that you'll have to re-apply with another module again later.

What would you prefer?

asimfastian’s picture

Please approve this module. I will add another different module for Drupal-7 in future.

patrickd’s picture

Status: Postponed » Reviewed & tested by the community
Issue tags: +PAreview: single application approval

Okay then, beside the minor issues I found in #19 there's nothing against promoting this module.

Tagging with PAReview: Single project promote

RTBC

asimfastian’s picture

I have made the above mentioned changes.

patrickd’s picture

with using constants I actually meant you should define one for both, term status enabled and disabled and actually make use of them everywhere in your own module instead of 0's and 1's.

project page is still not better :(

and I still don't understand why you provide a default value for the $tid in every function

asimfastian’s picture

Status: Reviewed & tested by the community » Postponed

I am not using '0' value explicitly anywhere in the code to disable a term. It is being set if check-box is not checked. That's why I did not defined it's constant

I have made the changes on project page and added a screenshot as well.

I have removed default values for $tids.

asimfastian’s picture

Status: Postponed » Reviewed & tested by the community
teyser’s picture

StatusFileSize
new8.99 KB

Hi Asim,

PFA

Please include the version in the info file.
Could you please explain further about your project to do more test.

Right now it provides option only checkbox in taxonomy edit page and add page.Depends on the status have you filter the content if i try to access the taxonomy URL (taxonomy/term/1).

Sorry for my poor english.

Regards,
-Raj.

asimfastian’s picture

I didn't filter the content. I added the facility to get/set status of a taxonomy. Now it depends upon the particular developer how he uses it.

teyser’s picture

Hi Asim,

Thanks for your information.

Regards,
-Raj.

asimfastian’s picture

who will approve this issue?

patrickd’s picture

Status: Reviewed & tested by the community » Fixed

Sorry for the waiting time, as there have been no further objections, I promoted your sandbox to a full project.
New URL: Now that this experimental project has been promoted, you'll need to update the URL of your remote repository or reclone it:
git remote set-url origin asimfastian@git.drupal.org:project/term_status.git

Thanks for your contribution!

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.

asimfastian’s picture

Thanks patrickd. I will also be more active in reviewing other project applications. But I see an issue here. My project has been promoted but I have not been granted permissions to create full projects without going through sandbox process. Please look into it and grant me this permission. I appreciate your help in this regard.

patrickd’s picture

I actually explained to you in comment #19 that I can't give you the permission to create full project because this project is too small and instead I would promote this project manually - you agreed on that in the next comment

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Issue description updated