Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
All edits to contact module categories seem to be performed with a DELETE + INSERT rather than an UPDATE. This not only adds one extra query but also messes up the ID as the table uses AUTO_INCREMENTed IDs.
Also, atm multiple categories can be set to be "selected" in the site-wide contact form's Category drop down. This doesn't make sense and I've added an additional query in the patch to address this.
ah, and I'm sure that there'll be a couple of coding standards niggles :P
Please let me know,
-K
Comment | File | Size | Author |
---|---|---|---|
#24 | contact.module_21.patch | 27.24 KB | Zen |
#20 | contact.module.3.patch | 27.45 KB | Zen |
#18 | contact.module_15.patch | 27.63 KB | Zen |
#17 | contact.module.diff2 | 35.64 KB | Zen |
#16 | contact.module_14.patch | 26.77 KB | Zen |
Comments
Comment #1
Zen CreditAttribution: Zen commentedBlatant error. Patch recalled :P
-K
Comment #2
Zen CreditAttribution: Zen commentedUpdated code.
Cheers
-K
Comment #3
Zen CreditAttribution: Zen commentedRemoved '' from around the %d..
-K
P.S and thanks cvbge :)
Comment #4
Zen CreditAttribution: Zen commentedwrong patch submitted :/
-K
Comment #5
Zen CreditAttribution: Zen commentedComment #6
Dries CreditAttribution: Dries commentedCoding style needs work. We don't wrap queries like that.
Comment #7
Zen CreditAttribution: Zen commentedAh, but I had to try.. Patch attached. Please also look into the following URLs:
Example query with comment: http://drupal.org/node/2497
Pretty much every query: http://drupaldocs.org/api/head/file/database/updates.inc/source
Cheers,
Karthik.
Comment #8
Cvbge CreditAttribution: Cvbge commentedStill wrapped
Comment #9
Zen CreditAttribution: Zen commentedThanks :)
-K
Comment #10
Dries CreditAttribution: Dries commentedBetter yet would be to convert the contact module to the forms API's _validate _execute model and fix this problem while you're at it. Is that something you can work on, Zen?
Comment #11
Zen CreditAttribution: Zen commentedSure. Can you commit this now though? I will have to do some reading before getting this sorted.
Cheers
-K
Comment #12
Zen CreditAttribution: Zen commentedBesides the previous fixes:
-Conversion to _validate + _submit model..
-Split replaced by explode - faster
-Fixed typos: Recipient
-Fixed weight defaulting to -10
-Popped mail subject formatting into a t()
-Popped '--' formatting into a t()
Cheers
-K
Comment #13
Zen CreditAttribution: Zen commentedThe weight issue has been fixed elsewhere.
Besides all the above fixes, this patch:
-does a lot of documentation fixing/rewriting.
-general formatting fixes (which makes the patch look very big :S).
-renamed contact_user_mail form functions to contact_mail_user for consistency.
I unfortunately still haven't got my head wrapped around the use of url() or l(), and the seemingly inconsistent use of the absolute_url flag everywhere. So I've left those as is, and will address them if needed later on.
Thanks
-K
Comment #14
Zen CreditAttribution: Zen commentedJust noticed a missing comma. I've also removed the link to the ?q=profile page. This is dependant on the profile module and shouldn't really be here..
-K
Comment #15
Dries CreditAttribution: Dries commentedTested, reviewed and committed. Thanks.
Comment #16
Zen CreditAttribution: Zen commentedReopening for related issue. This is also an amalgam of fixes for some of the contact module issues reported + others.. I thought it best to just maintain one patch rather than hop around here and there..
Attached patch:
I believe that covers it. Please let me know.
Thanks :)
-K
Comment #17
Zen CreditAttribution: Zen commentedThis column-wise diff might ease some of the pain of reviewing :)
Thanks
-K
Comment #18
Zen CreditAttribution: Zen commentedBesides the above fixes, attached patch:
Please review.
Thanks
-K
Comment #19
webchickPatch applies cleanly and makes lots of nice improvements. Tested the module, everything still works.
However, -1 to the hook_help changes. Your way may be better (looks like it, but not sure, we went around and around on this -- see http://drupal.org/node/26139 for the original patch), however it breaks consistency with all the other core modules' hook_help functions which were auto-generated from the handbook pages. It would be interesting to start another issue to discuss whether sprintf()ing the big long lines of text with HTML is a better approach; if so, a patch will need to be rolled for all core modules.
Also:
- '#value' => $user->name .' <'. $user->mail .'>',
+ '#value' => sprintf('%s <%s>', $user->name, $user->mail),
Why is the second there an improvement? It seems harder to read and is not standard (Drupal tends to use concatenation everywhere).
- // Set a status message:subject
+ // Update user.
drupal_set_message(t('Your message has been sent.'));
Same here.. I get that the first comment is not very clear, but don't see that "update user" accurately explains how that works.
Comment #20
Zen CreditAttribution: Zen commentedThanks for the review webchick :)
Attached patch:
-keeps up with HEAD
-replaces drupal_goto with return (where applicable) as per Adrian's patch. I've used return ''; to implement a return to the frontpage. I trust this is fine.
-removes all sprintfs and replaces with . notation.
I've not done anything about the "update user" comment as it's imo fine as it is. The nature of the 'update' is made evident by the following statement.
Please re-review - thanks :)
-K
Comment #21
Dries CreditAttribution: Dries commentedI'd like these fixes to go in. If people can test/review this patch, that would be much appreciated!
Comment #22
Zen CreditAttribution: Zen commentedI'm going to set this to RTC:
a) Webchick has reviewed the code end of things and was only unhappy about a couple of cosmetic issues.
b) I've fixed and reviewed these issues: i.e. the use of sprintfs.
Thanks
-K
Comment #23
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedmost recent patch doesn't apply.
Comment #24
Zen CreditAttribution: Zen commentedah. My cvs version was stuck at 1.41. I've added in the 1.42 'www.drupal.org' -> 'drupal.org' patch.
Thanks
-K
Comment #25
Zen CreditAttribution: Zen commented(patches cleanly against 1.42).
Comment #26
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks.
Comment #27
Zen CreditAttribution: Zen commented