Patch for problems found in code review
stella - October 6, 2008 - 13:54
| Project: | Node comments |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hi,
CivicActions is reviewing and upgrading multiple modules for use on client sites. Attached is a patch for problems found in relation to differences between Drupal 5 and Drupal 6.
The changes cover the following areas:
- The path
'admin/user/access'has changed to'admin/user/permissions'(http://drupal.org/node/114774#permissions) - Comment settings are now per node type, so instead of using the variable
comment_form_location, we should be looking forcomment_form_location_blog,comment_form_location_story, etc. (http://drupal.org/node/114774#comment_settings_per_node_type) - Form API now uses the
$form_statevariable, see http://drupal.org/node/144132 for more info. - Use the new
ip_address()function instead of$_SERVER['REMOTE_ADDR'](http://drupal.org/node/114774#ip-address)
For the 2nd one, there is one instance of the comment_form_location variable which I didn't fix. It still needs to be corrected, but I was unsure how you wanted to handle it, since the node type isn't available in the function in which it is used. It appears on line 160 of nodecomment.module.
Cheers,
Stella
| Attachment | Size |
|---|---|
| nodecomment_upgradeD6_0.patch | 4.99 KB |

#1
This applies cleanly and everything looks good. Marking RTBC.
#2
Thanks stella and catch.
stella, regarding the instance of
comment_form_locationon the settings form, this setting applies to all content types and I don't think we really want to have a separate setting for each content type a site has, do we?#3
sirkitree: the thing is that
comment_form_locationwas a variable provided by core in Drupal 5. It no longer exists in Drupal 6, so you can't use it. Drupal 6 now has separate comment settings for each content type. I'm afraid it's not a matter of which we would prefer to have.#4
#5
There is still one usage of the deprecated variable 'comment_form_location' on line 160 of nodecomment.module