Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Aug 2012 at 14:42 UTC
Updated:
30 Jul 2013 at 01:12 UTC
Jump to comment: Most recent file
Comments
Comment #1
Milena commentedWhile waiting for manual review of your module please correct issues found by automatic review:
http://ventral.org/pareview/httpgitdrupalorgsandboxcainrus1742794git
What's more consider participating in Review bonus to get your application reviewed sooner.
Comment #2
swarad07You might want to consider creating branches instead of working on the master branch.
http://ventral.org/pareview/httpgitdrupalorgsandboxcainrus1742794git
Cheers,
Swarad
Comment #3
Milena commentedHello,
It seems that Inject provides very similar functionality. Could you describe how your module differs?
We prefer collaboration over competition, therefore we want to prevent having duplicating modules on drupal.org. If the differences between these modules are not too fundamental for patching the existing one, we would love to see you joining forces and concentrate all power on enhancing one module. (If the existing module is abandoned, please think about taking it over).
Please remove the LICENSE.txt file. Drupal.org will add the appropriate version automatically during packaging so your repository should not include it.
.install file
hook_uninstall()
While you delete all table with drupal_uinstall_schema you are also removing any data from this table. There should be no need to perform db_query().
.module file
$items['admin/teletrade/node-custom-headtags']It is better to use common names. If you want to credit yourself you have README.txt or project page for it.
hook_nodeapi()
if ('view' === $op && variable_get('node_custom_html_' . $node->type, false)) {It's a yoda condition (worse readability). Also false should be FALSE.
Overall
You should remove any variables you use in hook_uinstall() in your .install file.
Comment #4
Milena commentedComment #5
danny englanderManual Review
Greetings. I installed the module on a local drupal 6 dev site I have, here is some feedback.
admin/teletrade/node-custom-headtags. That seems like a non standard Drupal admin link.
$items['admin/teletrade/node-custom-headtags']on line 8 for your admin link, it should probably be$items['admin/settings/node-custom-headtags']node_custom_html" but your files are named "custom_head_html" so there is a mismatch there. I am guessing that is why I was not able to get very far with testing this.Thanks!
Comment #6
danny englanderah, it seems I did a review at the same time as Milena in #3 & 4 but I think I've pointed out some other items as well...
Comment #7
cainrus commentedMilena, swarad07, highrockmedia
Thank you for review. You helped me very much.
Done.
Done
Module Inject is for site-wide settings.
My module allows to add custom head html only for concrete node. But it's gooe idea to combine 2 modules(or more similiar) into one.
Thank you for idea.
Done
It was a bug, i wanted to clean table variable from settings with module name prefixes. Fixed.
Module was developed for my company, i forgot to change settings path. Fixed.
Some times yoda style can help you to avoid errors. When you type $type = 'page' instead of $type == 'page'. But fixed anyway.
Already fixed.
Done
Added drupal_set_message to hook_install with instructions.
Fixed.
Fixed.
Fixed.
Fixed.
Thank you all for review! You helped me very well.
Comment #8
cainrus commentedComment #9
grisendo commentedPlease, explain the difference in your project's page (http://drupal.org/sandbox/cainrus/1742794).
After DELETE query in hook_uninstall in your .install file, clear variables cache:
cache_clear_all('variables', 'cache');Comment #10
cainrus commentedgrisendo
Done.
Done. Thank you for your review, i've been learned new things.
Comment #11
stborchertThe file .gitignore can be removed from the repository.
Additionally you should consider using filter_xss() in function node_custom_head_html_nodeapi() (when adding the data to the head). This prevents printing malicious code entered by the user (see Writing secure code for more details).
Comment #12
pirog commentedPotential major issues:
Although this is more performant:
db_query("DELETE FROM {variable} WHERE name LIKE 'node_custom_head_html_%'");I think it is generally best to use variable_del(). I think the impetus for this is if someone had a module named node_custom_head_html_WHATEVER you would also delete all of their variables as well.
Here are some minor issues:
Comment #13
sreynen commentedComment #14
teyser commentedHi Cainrus,
Please the list of issues faced when installed your module.
1.Could you please mention the version of this module in the .info file.
2.Please find the attached image for your reference to identify the issue of your module.
3. Custom HTML data not stored properly in the DB.
4. Got warning when install and create custom html head for the selected content type.
Regards,
-Raj.
Comment #15
kscheirerIn your README, we don't call admins "root" - user 1 does have special permissions, but "Setup permissions for user roles" or something similar would be better.
In your .info file, the name should match your filenames: "Node Custom Head HTML".
In node_custom_head_html_nodeapi() - if you just want a single field returned from the sql statement, you can use db_result().
Referring to #3 above, node_custom_head_html_save() should only take 2 arguments, just remove the third.
Regarding #4 above, you should probably check the $nid has a value before saving. Also, don't trust drupal_write_record() so much - it's a convenient function but it can fail silently.
You should also remove your .gitignore file from the repo, and your project page still refers to the path "admin/teletrade/node-custom-headtags" even though your module is properly updated to use admin/settings/node-custom-headtags.
Those are all fairly minor issues though, RTBC from me.
Comment #16
cainrus commentedHi Teyser!
The version string will be added by drupal.org when a release is created
Fixed!
Hi Kscheirer!
Fixed!
Fixed!
Fixed!
Fixed!
Fixed!
---
Thank you for your thoughtful review guys!
Comment #17
kscheirerDon't trust drupal_write_record() so much - it will fail silently if anything goes wrong - check the return value. That's really minor though. This issue has been waiting a long time, thanks for sticking with it!
Thanks for your contribution, cainrus!
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.
----
Top Shelf Modules - Enterprise modules from the community for the community.