To reproduce, go to ?q=admin/build/contact and create two categories with just the default options. Then go to ?q=contact, and notice that you have a notice... ha!
This patch should be easy to create for someone new to Drupal.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | contact-default-category-4.patch | 863 bytes | gábor hojtsy |
| #5 | contact-default-category-3.patch | 895 bytes | blackdog |
| #3 | contact-default-category-2.patch | 880 bytes | blackdog |
| #2 | contact-default-cateogory.patch | 861 bytes | jody lynn |
| #1 | default_category_notice.patch | 687 bytes | blackdog |
Comments
Comment #1
blackdog commentedAdded an isset(), notice gone.
Comment #2
jody lynnNew patch. Isset() returns a boolean so it will not work when there is an actual default_value to be set. This patch sets '--' as the default_value when there is none set.
Comment #3
blackdog commentedBetter patch, applies well and does the trick. Fixed a minor spacing issue.
Comment #4
gábor hojtsyWell, I would use t('-Please select-') or something along those lines as a default category, just like in forum module for example. That gives a bit more information to the visitor on what should be done.
Comment #5
blackdog commentedUpdated the patch with the phrase '- Please choose -', like in the forum module.
Comment #6
jody lynnTested patch successfully.
Comment #7
gábor hojtsyGreat. I slightly modified the patch to omit the $placeholder variable which we don't require. This is less lines and cleaner. Committed this one. Thanks!
Comment #8
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.