Closed (fixed)
Project:
Automatic Nodetitles
Version:
5.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
6 Sep 2007 at 19:19 UTC
Updated:
3 Sep 2008 at 21:49 UTC
Jump to comment: Most recent file
Comments
Comment #1
fagothat sounds useful - would be nice if you could provide a patch for that :)
Comment #2
robloachSounds like a deal ;-) .
Comment #3
robloachYou mind reviewing this patch?
Comment #4
robloachTo test it, apply the patch, and then edit a content type. Under "Automatically generate the node title and hide the node title field.", you'll see "Title Optional". Check Title Optional, but don't check Automatically Generate. Now when you edit/add a node, the title will be there, but it will be optional. Not putting in the title will generate the title for you using the provided pattern. Putting in the title will use the given title.
Comment #5
fagoops, sry for the late review. I somehow overlooked that patch. sry!
However I don't like the UI you build. Now there are two checkboxes - but it doesn't make sense to check both. So perhaps, there would be better radio buttons:
* Disabled (default)
* Automatically generate the node title and hide the node title field.
* Automatically generate the node title, if the title field is left empty.
Then you have introduced a new variable, but you forgot to clean it up on module uninstallation.
Comment #6
robloachI like the idea of the radio buttons! I'll have a look at it sometime in the near future.
Comment #7
robloachRefactored using the single ant variable, with the three radio buttons as specified in your post above.
Comment #8
fagowow, that was quick... :)
much better, however I'd like to see some minor improvements before committing it:
* instead of using $nodetitlestatus, implement a short function "auto_nodetitle_get_setting($type)" to shorten the if(). don't worry about calls to variable_get, they aren't expensive.
* please use defines for the settings 1 and 2, so that the code is more readable. e.g. AUTO_NODETITLE_OPTIONAL. This may even make some comments redundant.
Comment #9
robloachSo demanding! ;-)
This patch replaces $nodetitlestatus with a new auto_notetitle_get_setting($type) function, and uses some new constants: AUTO_NODETITLE_DISABLED, AUTO_NODETITLE_ENABLED and AUTO_NODETITLE_OPTIONAL.
Comment #10
amitaibuSubscribe
Comment #11
robloachApparently fixed by this.
Comment #12
amitaibuThanks Rob and Fago, great addition.
Comment #13
fagooh, I forgot to close the issue. Thanks Rob Loach, good work :)
Comment #14
(not verified) commentedComment #15
doc2@drupalfr.org commentedEDIT: to dmitri01 in #16: sorry, this post was a complete mess. Regards, Arsène
Comment #16
dmitrig01 commentedPlease open a new issue for this
Comment #17
fago