This project allows the site administrator to add help text for node title field. By default Drupal do not have provision to add help text, custom code needs to be written each time to add help text. This small module provides a way to enter help text per content type which is displayed on node add/edit page. Configuration is available at content type edit form.

Project page link

https://www.drupal.org/sandbox/jadhavdevendra/2423373

Setting up this repository locally for the first time

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/jadhavdevendra/2423373.git node_title_help_text
cd node_title_help_text

Manual reviews of other projects

https://www.drupal.org/node/2407867#comment-9627337
https://www.drupal.org/node/2427175#comment-9628185
https://www.drupal.org/node/2427731#comment-9631169

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PA robot’s picture

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.

PA robot’s picture

Status: Needs review » Needs work

Git clone failed for http://git.drupal.org/sandbox/jadhavdevendra/2423373.git while invoking http://pareview.sh/pareview/httpgitdrupalorgsandboxjadhavdevendra2423373git

Git clone failed. Aborting.

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

jadhavdevendra’s picture

Status: Needs work » Needs review
FileSize
201.12 KB

I do not see it failed, can someone help me here?

Please see the this image.
https://www.drupal.org/files/issues/pareview.sh__1.png

or direct link
http://pareview.sh/pareview/httpgitdrupalorgsandboxjadhavdevendra2423373git

vinmassaro’s picture

It looks like you need to change line 40 in node_title_help_text.module from:

* @param &$form_state

to

* @param array &$form_state

wuxiaogu’s picture

I think you should add a .install file to uninstall variables.

jadhavdevendra’s picture

@vinmassaro changed to the suggested, it still gives error
43 | ERROR | Type hint "array" missing for &$form_state

@wuxiaogu Added install file as suggested, also added hook_node_type_delete to remove the variable with content type delete operation.

@vinmassaro @wuxiaogu Thanks much for the help.

naveenvalecha’s picture

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

jadhavdevendra’s picture

Issue summary: View changes
jadhavdevendra’s picture

Issue summary: View changes
jadhavdevendra’s picture

Title: D7 Node title help text » [D7] Node title help text
Issue summary: View changes
Issue tags: +PAreview: review bonus
jaipal’s picture

#3 , #6

Hi Devendra..

You have mentioned the @param in comment in submit handler. Drupal does not allow the @params in submit, validate handlers.

Your submit handler is:
/**
* Submit handler for node type form. Stores help text in variable.
*
* @param string $form_id
* The unique string identifying the desired form.
* @param array &$form_state
* A keyed array containing the current state of the form.
*/
function node_title_help_text_node_type_form_submit($form_id, &$form_state) {
// In case of change of machine name, remove the old variable.
if (isset($form_state['values']['old_type'])) {
$old_name = 'node_title_help_text_' . $form_state['values']['old_type'] . '_title_help';
variable_del($old_name);
}
$name = 'node_title_help_text_' . $form_state['values']['type'] . '_title_help';
$value = $form_state['values']['title_help'];
variable_set($name, $value);
}

You need to remove both @params from comments.

Just remove below line of code:
* @param string $form_id
* The unique string identifying the desired form.
* @param array &$form_state
* A keyed array containing the current state of the form.

You can follow section "Form-generating functions" in https://www.drupal.org/coding-standards/docs .

jadhavdevendra’s picture

Thank you very much @jaipal, this removed the only error reported by code sniffer.
http://pareview.sh/pareview/httpgitdrupalorgsandboxjadhavdevendra2423373git

Swarnendu-Dutta’s picture

Hi Devendra,

Thanks for your contribution.

Nice and simple module.
Have you looked into Label Help. I think it does the same job for form fields. I guess it would be a good idea to merge your module with that.

Just a suggestion..Otherwise looks ok to me.. :-)

naveenvalecha’s picture

@jadhavdevendra ,
Please specify the differences on your project page and also in the issue summary how your module is different from the above mentioned Label Help module
@Swarnendu-Dutta,
Is there anything else that you found blocker and stopped you to set it to RTBC ?

Swarnendu-Dutta’s picture

@naveenvalecha,

All looks ok...i dint find anything else..just that this module can be merged with Label Help as both are on the same page..

D2ev’s picture

Status: Needs review » Needs work

Please check with existing module available like https://www.drupal.org/project/title_field_ui and follow ways to contribute - https://www.drupal.org/contribute/development

It would be better if you can contribute a patch to other modules.

jadhavdevendra’s picture

Status: Needs work » Needs review

Thanks much @Swarnendu-Dutta @naveenvalecha @D2ev for the review.
Label Help - This adds provision to add help text below the field label. This module do not touch description of the field. This module do not touch title field of the node.
Title field ui - This module allows the title field to be edited the way other fields are edited. With provision to add help text and size as well. This uses field API, Form API and Field UI (core) module.

My module is small and simple, only makes use of form API. We should release this as a full project referencing other projects as similar once. I will work on back porting this to D6 (which is easy) as well as release of D8 (If not already added in core).

cfischer83’s picture

Status: Needs review » Needs work

First, I think this module is a great idea and absolutely needed!

Automated Review

No best practice issues identified by pareview.sh : http://pareview.sh/pareview/httpgitdrupalorgsandboxjadhavdevendra2423373git

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Does not cause module duplication and/or fragmentation.
I agree with jadhavdevendra. Although there are similarities to other modules, this is a different direction and usage. However, I'm going to leave this in "Needs work" until the project page references similar modules and when to use this vs. them.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements. / No: List of security issues identified.]
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. (*) Major finding, needs work
  2. (+) Release blocker
  3. Just a recommendation
  4. ...]
  • (+) The project page needs to reference similar modules and when to use this vs. them.

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

jadhavdevendra’s picture

Status: Needs work » Needs review

Thanks @cfischer83 for review. I have updated the project page with related modules reference.

Swarnendu-Dutta’s picture

Status: Needs review » Reviewed & tested by the community

setting this to RTBC...

naveenvalecha’s picture

Assigned: Unassigned » klausi

Thanks for your contribution @jadhavdevendra,

Automated Review

Review of the 7.x-1.x branch (commit b09b1f9):

  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
No: Follows the guidelines for in-project documentation and/or the README Template.Please move the configurations to the Configuration section.
Code long/complex enough for review
Maybe: Follows the guidelines for project length and complexity.The module has 5 functions but the code is not more than 120 lines.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
  1. The Git commits are not connected to your user account. You need to specify an email address.See https://www.drupal.org/node/1022156 and https://www.drupal.org/node/1051722
  2. hook_help() is missing in this module.
  3. It would be nice if you also add the configuration page to select the node types on which administer select the content types of node Title field helptext.
  4. All variables should be with default values .
  5. node_title_help_text_form_node_form_alter : $form['title']['#description'] = nl2br(field_filter_xss($description));I think the nl2br is not needed here.Please add a comment. That's fine to use it like that.

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

jadhavdevendra’s picture

1. Updated readme - moved configuration text to configuration section
2. Now git commits are connected to my user account.
3. All variable_get are now with default values.

klausi’s picture

Issue summary: View changes

Removed comments that were not source code reviews.

klausi’s picture

Assigned: klausi » Unassigned
Status: Reviewed & tested by the community » Fixed
Issue tags: +PAreview: single application approval

manual review:

  1. "'#title' => 'Title field helptext',": all user facing text must run through t() for translation.
  2. This project is too short to approve you as git vetted user. We are currently discussing how much code we need, but everything with less than 120 lines of code or less than 5 functions cannot be seriously reviewed. However, we can promote this single project manually to a full project for you.

Otherwise looks good to me. I think this a lot simpler than the existing modules, so IMO the duplication is justified.

Thanks for your contribution, jadhavdevendra !

I have promoted this project for you: https://www.drupal.org/project/node_title_help_text

Now that this experimental project has been promoted, you'll need to update the URL of your remote repository or reclone it.

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

jadhavdevendra’s picture

Thank you very much @klausi for promoting this to full project.
As per your suggestion, I have added t() function to user facing text, and did a first release.

Status: Fixed » Closed (fixed)

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