Closed (fixed)
Project:
Mobile Tools
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Sep 2011 at 15:03 UTC
Updated:
14 Oct 2011 at 21:25 UTC
Jump to comment: Most recent file
Comments
Comment #1
minoroffense commentedYou're right. Per the Drupal coding standard, they should all be underscores. No dashes. http://drupal.org/coding-standards#naming
Persistent Variables
Persistent variables (variables/settings defined using Drupal's variable_get()/variable_set() functions) should be named using all lowercase letters, and words should be separated with an underscore. They should use the grouping/module name as a prefix, to avoid name collisions between modules.
We'll have to write a patch to rename them along with an update hook to migrate the old values to their new home.
Feel up to the task?
Comment #2
melon commentedSure, I put the task of rolling a patch for this on my todo list. Will get back with it soon.
Comment #3
melon commentedI rolled the patch against the 7.x-2.x branch. Please test.
Please note that my editor auto-corrected many whitespace and no-end-of-line-marker issues hence the largish diff.
I was also wondering whether there are modules that rely on mobile_tools. They should change their variable gets as well.
Comment #4
minoroffense commentedIf other modules are referencing the variables directly they'll have to update. But since this is a dev version, I'm not too concerned about forcing updates on other modules. The other maintainers should expect dev code to be in flux.
But it is a good point and worth including in the release notes.
Comment #5
minoroffense commentedI added a few code comments and used the get_t() in the update hook just in case (not sure if this is still needed in D7 but what the hell, can't hurt).
Thanks, the patch looks good (didn't see anything break) and I'll apply it to the 7.x-2.x branch.
Comment #6
minoroffense commentedI trimmed out the whitespace fixes to make the patch easier to apply.
The trim was done in a separate commit.
Comment #7
melon commentedYes, I suppose dev versions shouldn't really care about these kind of changes, especially if it fixes something.
Thanks for taking your time and dealing with this issue.
Comment #8
minoroffense commentedCommitted