This module allows a user to select node types on which they would like to disable the "Promote to front page" option. Although a user can set this option on the content type configuration page, this does not stop a content author from reselecting the option on a node by node basis. Promote Disable disables the checkbox so that it can't be clicked. It also stops nodes from being programmatically promoted to the front page.

Project page: https://drupal.org/sandbox/jamiehollern/2014429
Git clone: git clone --branch 7.x-1.x jamiehollern@git.drupal.org:sandbox/jamiehollern/2014429.git promote_disable

Application reviews:

Comments

RavindraSingh’s picture

Status: Needs review » Needs work
jamiehollern’s picture

Status: Needs work » Needs review

All issues mentioned have been fixed.

PA robot’s picture

Status: Needs review » Needs work

Link to the project page and git clone command are missing in the issue summary, please add them.

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then 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.

zestagio’s picture

There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732

jamiehollern’s picture

Status: Needs work » Needs review

Master deleted, project page link and Git clone link added.

labor b’s picture

Status: Needs review » Needs work
StatusFileSize
new8.08 KB

Hi, I just reviewed your project. These are my suggestions:

In promote_disable_form instead of building your node types array twice via _promote_disable_node_types(), you might want to store it into a variable.

  $node_types = _promote_disable_node_types();

  $form['promote_disable_node_types'] = array(
    '#type' => 'select',
    '#multiple' => TRUE,
    '#size' => count($node_types),
    '#title' => t('Node types'),
    '#default_value' => variable_get('promote_disable_node_types'),
    '#options' => $node_types,
    '#description' => t('Select the node types on which you would like to disable the "Promoted to front page" option.'),
  );

Line 71, variable_get should always get a default value as second param.
Also check for other occurences of variable_get.

Line 77, you are adding your custom form_submit function twice.

      array_unshift($form['#submit'], '_promote_disable_form_submit');
      $form['#submit'][] = '_promote_disable_form_submit';

I guess, you should change permission to "administer content types" as your settings do affect all content types available.

Just a suggestion:
User interface seems irritating to me. I can disable the promote option in the admin settings form, but on the node form it's still present. It is just disabled. Also on the node type form I can still select a default value, which would be obsolete if i checked disable promote. I would just hide this option in both forms, at it isn't needed.

jamiehollern’s picture

Status: Needs work » Needs review

labor b, thanks for your review. Your points were all very good so I have actioned all of them, including the UI advice. Thanks once again.

chrisfree’s picture

Hello,

Just did a high-level review of your module's code. I have a few basic suggestions:

  • Consider replacing usage of "node types" with "content types" throughout user interfaces. "Node types" might be confusing to some users since core Drupal uses "Content Types" to describe node types.
  • You might also consider reorganizing your options management UI. Here I've moved what was previously the "description" of the single form element out into its own markup element. Since this description explains how to use this interface it makes sense for it to come first, followed by the actual select list.
    /**
     * Page callback: Promote Disable settings.
     *
     * @see promote_disable_menu()
     */
    function promote_disable_form($form, &$form_state) {
      $node_types = _promote_disable_node_types();
    
      $form = array();
      $form['promote_disable_explanation'] = array(
        '#markup' => t('Select the content types on which you would like to disable the "Promoted to front page" option.'),
      );
    
      $form['promote_disable_node_types'] = array(
        '#type' => 'select',
        '#multiple' => TRUE,
        '#size' => count($node_types),
        '#title' => t('Content types'),
        '#default_value' => variable_get('promote_disable_node_types', array()),
        '#options' => $node_types,
      );
    
      return system_settings_form($form);
    }
    

Those are my only suggestions. I ran the module through Coder and saw no code issues whatsoever. Nice work on this module, I'll definitely be reaching for this the next time I need to hide this option.

RavindraSingh’s picture

Status: Needs review » Reviewed & tested by the community

@jamiehollern, i have tested the functionality of this module. it seems working fine. @chrisfree has raised the valid points which needs to be corrected.

Nice work on this module.

jamiehollern’s picture

Chris, thanks for your suggestions; they were very helpful I have implemented them in full. Thanks for reviewing.

Ravindra, thanks once again for your review and again for the previous one.

jamiehollern’s picture

Issue summary: View changes

Added project page link and Git clone link.

jamiehollern’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +PAreview: review bonus

Adding PAReview: review bonus tag.

klausi’s picture

Status: Needs review » Fixed
Issue tags: -PAreview: review bonus

Looks good to me after a visual code review.

This was RTBC already, so ...

Thanks for your contribution, jamiehollern!

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.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Added review bonus tag and application reviews.

avpaderno’s picture

Issue summary: View changes
Status: Closed (fixed) » Active
avpaderno’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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