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.
there's a need to occasionally limit machine names to a select number of characters. see #2244805: Fix d6_contact_category exceeding bundle's max length for one such example, where the bundle machine name is required to be 32 characters or less.
additional options should be added to the DedupeBase process plugin to substr the destination machine name value.
Comment | File | Size | Author |
---|---|---|---|
#23 | interdiff-2247903-21-20.txt | 4.09 KB | bdone |
#23 | 2247903-dedupe-substr-21.patch | 14.68 KB | bdone |
#2 | imp-2247903-machine-name-substr.patch | 6.52 KB | bdone |
Comments
Comment #1
bdone CreditAttribution: bdone commentedworking on a patch for this...
Comment #2
bdone CreditAttribution: bdone commentedhere's a first pass at this one. a sample usage, from #2244805: Fix d6_contact_category exceeding bundle's max length, could look like below where we are adding length...
Comment #3
benjy CreditAttribution: benjy commentedLets use Unicode::substr()
We also need to discuss how the truncating will work with dedupe. This process plugin is nearly always used with dedupe and that currently has no context of the maximum length of the machine name.
Comment #4
benjy CreditAttribution: benjy commentedWe discussed this on IRC and decided that the best approach would be to:
Comment #5
bdone CreditAttribution: bdone commentedworked on comments in #4 a little bit. this does not yet address bullets #1 and #4, but i'm posting what i have so far.
Comment #6
bdone CreditAttribution: bdone commentedupdated title, based on #4.
Comment #7
benjy CreditAttribution: benjy commentedThanks for working on this.
Should we expand on this to say that "null" or no value will capture the entire string?
I can't see where we use configuration where we couldn't simply use $start and $length?
Other than above, It's looking good so far.
Comment #8
bdone CreditAttribution: bdone commenteddoes this patch read any better?
not quite sure what you mean here @benjy. add the start config key alongside length, for each migration using dedupe_entity, or something else?
Comment #9
benjy CreditAttribution: benjy commented@bdone, ignore my last comment I missed this line in dreditor as it was greyed out.
plugin = new DedupeEntity($configuration, 'dedupe_entity', array(), $this->getMigration(), $this->entityQueryFactory);
The error messages ready better, thanks.
Comment #10
bdone CreditAttribution: bdone commentedthanks @benjy.
here's a go at addressing that one.
Comment #11
bdone CreditAttribution: bdone commentedi think this patch now has everything from the list in #4, except #1...
i do not know how to address this one. any suggestions here would be appreciated.
Comment #12
bdone CreditAttribution: bdone commentedComment #15
bdone CreditAttribution: bdone commentedComment #16
bdone CreditAttribution: bdone commentedsame patches as #10. trying another test.
Comment #18
bdone CreditAttribution: bdone commentedi managed to track down why MigrateDrupal6Test was failing. trying once more...
Comment #20
bdone CreditAttribution: bdone commentedre-rolled patch for psr-4 and fixed failing test issue in while loop.
Comment #21
bdone CreditAttribution: bdone commentedComment #23
bdone CreditAttribution: bdone commentedone more try with unit test passing and an earlier substr of value...
Comment #24
mikeryanLooks good to me - the one open issue here is the idea of defaulting machine names to 32 characters, but I also don't see how that would work without introducing complection between the machine_name and dedupe_entity plugins.
Comment #25
alexpottCommitted df301e7 and pushed to 8.x. Thanks!