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.
Different user actions create different punctuation in watchdog messages.
User block/delete use arrows-
watchdog('user', 'Blocked user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
watchdog('user', 'Deleted user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
User creation uses parentheses -
watchdog('user', 'New user: %name %email.', array('%name' => $form_state['values']['name'], '%email' => '<' . $form_state['values']['mail'] . '>'), WATCHDOG_NOTICE, l(t('edit'), 'user/' . $account->uid . '/edit'));
Comments
Comment #1
erikwebb CreditAttribution: erikwebb commentedAttached patch converts "New user" message to arrows for consistency with the majority.
Comment #2
erikwebb CreditAttribution: erikwebb commentedUser creation snippet in OP was post-patch. Original -
Comment #4
erikwebb CreditAttribution: erikwebb commentedFailed to run other modules tests.
Comment #5
erikwebb CreditAttribution: erikwebb commentedComment #7
superspring CreditAttribution: superspring commentedPatches what is described above - removing extra puntuation.
Comment #8
superspring CreditAttribution: superspring commentedPatches change above for D8.
Comment #9
lyricnz CreditAttribution: lyricnz commentedI like having the visual markers around the email address, so while I agree that we should be consistent, I would prefer that we put them everywhere: AccountFormController.php has three without <>, user.module has two with <> and user.pages has one of each :)
Comment #10
superspring CreditAttribution: superspring commentedI have searched the code base for email addresses that append a name. These instances now all have %name <%email> markup. %email by itself has been left as is.
Comment #11
lyricnz CreditAttribution: lyricnz commentedLooks OK to me. Consistency is good.
Comment #13
superspring CreditAttribution: superspring commented#10: watchdog_extra_punctuation-985360-10.patch queued for re-testing.
Comment #15
superspring CreditAttribution: superspring commentedRemoving the fix inside the tests. This seems to work now, not too sure why though...
Comment #17
superspring CreditAttribution: superspring commentedAttempt four
Comment #19
lyricnz CreditAttribution: lyricnz commentedUnnecessary change
How is this related to the change in watchdog message?
Unnecessary cleanup. Just fix the issue, make another patch for cleanup later. Ditto for the other three below.
Comment #20
superspring CreditAttribution: superspring commentedHey @lyricnz,
I've split this into three patches which addresses your issue above. Here I will upload two for 'code tidyup' and one for the 'bug fix'.
Comment #21
lyricnz CreditAttribution: lyricnz commentedThe first patch looks good (RTBC). The second, not sure I'd bother with.
Comment #22
chx CreditAttribution: chx commentedThe first one is good to go. As for AccountFormController it only contains an email address w/o a name so no need for arrows or parenthesis.
Comment #23
catchNot really into argument wrapping at all. Committed/pushed the first patch from #20, thanks!