The plugin is often necessary when migrating things that had a serial and we need a machine name and it's best to construct it from the human name. Iit's documented https://drupal.org/node/2135323 and it's tested.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 2150257_11.patch | 4.72 KB | chx |
| #11 | interdiff.txt | 721 bytes | chx |
Comments
Comment #1
chx commentedComment #2
mpgeek commentedComment #3
mpgeek commentedThis patch adds the test but i'm getting PHP Fatal error (calling method on non-object) from inside
MachineName::getTransliteration. My test string is not over 128 characters long as indicated in the summary, but it's unclear to me why this would be necessary. Either there really is a bug or i'm missing something here. Setting to needs review, hoping for feedback so I can finish this up.Comment #5
chx commentedThanks for the test, a few fixes were necessary: the plugin needed a test class to set the transliteration and also process plugins work pipeline-like, they get the current value of the pipeline as the first argument and spit out the next value in return. The other parameters are making process plugins powerful by making them stateful; the above behaviour would only allow for stateless. Finally, the machine name plugin has no configuration at all.
Congratulations on finding a bug in the plugin (I left in the dot because I copied from BlockBase. Opsie.)
Comment #7
chx commentedOh and that above 128 was meant to mean it needs a few Unicode characters not in ASCII: above 128 codepoints. So I added this.
Comment #8
jibranHere are some more points and suggestions.
desc line missing
Incomplete
@var block missing.
Tests
YEE___HaW :D
All kind of doxgen missing i.e. desc block for code,class and function.
Comment #9
chx commentedFixed the pieces needing fixes. (Test only classes containing two LoC that you can't even load because they are not PSR-0 don't need doxygen.)
Comment #10
dawehnerI don't really think the description matches to the actual code.
Comment #11
chx commentedHow about this?
Comment #12
dawehnerThank you!
Comment #13
webchickThis variable is a) not documented (neither here nor in the base class — it's @TODO), and b) not used in the code below. I mentioned this to chx, and he said that there is already a follow-up issue to further clean-up mapJoinable at #2152131: Clean up mapJoinable, so this will just get roped into that. Normally this variable is needed, when an actual migration is being tested, but it is not here, so it is superfluous for now, but may not always be, so it's best to keep it here to be safe.
With that follow-up filed, we are probably good to go here for now, so...
Committed and pushed to 8.x. Thanks!
Comment #15
chx commentedYeah, we've seen this random fail before...