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.
Importing d6_user_mail brings across the email templates that are sent to users. The tokens do not get converted.
I have a patch I am working on to address this, using user_update_7017's list of tokens.
Testing notes:
After running this patch you can go to /admin/config/people/accounts and in the email templates you should see tokens like "[site:name]" (desired) which replace the old "!site" style tokens.
Comment | File | Size | Author |
---|---|---|---|
#14 | 2551631-14.patch | 15.06 KB | quietone |
#11 | interdiff-9-11.txt | 1.15 KB | quietone |
#11 | 2551631-11.patch | 15.06 KB | quietone |
#9 | interdiff-2552631-2-9.txt | 14.14 KB | quietone |
#9 | 2551631-9.patch | 15.15 KB | quietone |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedRyan Weal created an issue. See original summary.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedThis patch adds a process plugin to migrate_drupal that converts tokens using the code from user_update_7017. I confirmed that the tokens listed there seem to be the same as D7.
The patch also updates d6_user_mail.yml to utilize the new plugin.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #5
quietone CreditAttribution: quietone commentedSince I've been working on the related issue, https://www.drupal.org/node/2353817, I'll have a go at this one.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAt this point it should just need updates to the appropriate tests. Sorry I dropped off on this one, was working on criticals at the sprint in Chicago last weekend and I'm busy with other things now.
Comment #7
quietone CreditAttribution: quietone commented@Ryan Weal, NP. I'm just glad I spotted it. And that I've learned enough to add to your work.
Updated the expected text for the tests.
I didn't see user_mail_user_mail_register_pending_approval_subject and user_mail_user_mail_register_pending_approval_body in D6, so changed them to mail_register_pending_approval_subject and user_mail_register_pending_approval_body which I did see.
Moved the plugin to the user module
Comment #9
quietone CreditAttribution: quietone commentedWell, messing up Variable.php was bound to happen sooner or later. Fixed that. Note the interdiff is against the patch in #2 because #6 is just plain wrong, not just because of variable.php but also because it includes a diff on a . file.
Comment #10
phenaproximaNice patch. Makes good sense and is well-tested.
Can this explanation be a bit more detailed? Maybe something like "This plugin replaces old !token placeholders with proper [tokens]." Paraphrase as desired :)
I don't think we're supposed to combine {@inheritdoc} with a comment. Let's ditch the comment.
Extra line of white space.
I find this error message awkward. Can we change the !is_array() to just is_string(), change the exception to "Value must be a string" or similar, and remove the var_export(), since that will muddy up the exception message and make it difficult to read?
Nice assertions -- very thorough. For bonus points, can we also add a test which checks that the plugin will throw an exception if given an array (or other non-string)? It should look something like this (in PHPUnit we would just use @expectedException, but we're not quite there yet):
I have it from @xjm that this is kosher in SimpleTest.
Comment #11
quietone CreditAttribution: quietone commented1. Fixed
2. Fixed
3. Fixed
4. Fixed
5. Thx. No bonus points yet. I've not figure out how to create $plugin, as in your example.
Comment #12
phenaproximaWorks for me.
Comment #13
webchickNo longer applies.
Comment #14
quietone CreditAttribution: quietone commentedSimple reroll, not tested locally.
No interdiff, due to changes in Variable.php
Comment #15
quietone CreditAttribution: quietone commentedAs agreed on IRC, set to RTBC
Comment #16
webchickCommitted and pushed to 8.0.x. Thanks!
Comment #19
quietone CreditAttribution: quietone commented