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.
Add API documentation to the Flatten process plugin
Comment | File | Size | Author |
---|---|---|---|
#18 | interdiff-16-18.txt | 1.38 KB | jofitz |
#18 | 2845481-18.patch | 2.28 KB | jofitz |
#16 | interdiff-15-16.txt | 508 bytes | jofitz |
#16 | 2845481-16.patch | 2.36 KB | jofitz |
#15 | interdiff-11-15.txt | 1.84 KB | jofitz |
Comments
Comment #2
quietone CreditAttribution: quietone as a volunteer commentedComment #3
phenaproximaSelf-assigning for review.
Comment #5
phenaproximaLet's convert from array() syntax to [] syntax.
This line is longer than 80 characters.
Comment #6
leslieg CreditAttribution: leslieg as a volunteer commentedTaking a look at this issue as part of SprintWeekend2017
Comment #7
leslieg CreditAttribution: leslieg as a volunteer commentedUpdated array syntax
Comment #8
leslieg CreditAttribution: leslieg as a volunteer commentedComment #10
leslieg CreditAttribution: leslieg as a volunteer commentedComment #11
leslieg CreditAttribution: leslieg as a volunteer commentedre-uploading the same patch file and interdiff as suggested in IRC. Also marking as Needs review. Looks like issue was not with this patch, but a more generic caching issue
Comment #13
leslieg CreditAttribution: leslieg as a volunteer commentedAutomated tests passed
Comment #14
phenaproximaThanks for your work on this, @leslieg! Unfortunately, in re-reading the documentation, I see several wording problems that might confuse and befuddle (confuddle?) folks inexperienced in Migrate sorcery (which is absolutely not your fault, this is all copied-and-pasted from the handbook pages).
The word "array" needs to be removed. Short array syntax is simply [5, 6], as opposed to array(5, 6). :)
Nit: This line exceeds 80 characters. But then again, it will not once the word "array" is removed.
"what was once a single value gets transformed into multiple value." This is confusing. To me, "multiple values" means something like ['foo', 'bar', 'baz']. This phrasing implies that such a value will be converted from an array to a scalar, which is not the case.
What we should say instead is that this will flatten a multidimensional array into a one-dimensional array. That would be consistent and easily explainable developer-friendly wording, IMHO.
Let's change this to an example using the default_value plugin. Using static_map here means we need to explain, if only in a cursory fashion, what static_map is doing. default_value would be MUCH easier to grok in the context of this example.
Comment #15
jofitz CreditAttribution: jofitz at ComputerMinds commentedDocumentation tweaks in response to #14 and an additional conversion from
array()
to[]
.Comment #16
jofitz CreditAttribution: jofitz at ComputerMinds commentedOops, missed the default_value plugin source.
Comment #17
phenaproximaLooking really good, except...
This explanation no longer matches the actual code of the example :) Let's have the default_value plugin return a nested array of arbitrary scalar values to demonstrate.
Comment #18
jofitz CreditAttribution: jofitz at ComputerMinds commentedExample rewritten.
Comment #19
ultimikeI think this looks good-to-go.
-mike
Comment #20
xjmStraightforward code documentation improvements can always go into any patch release, alpha, beta, or RC, so please always file them against the production branch (currently 8.3.x). Thanks!
Comment #22
jofitz CreditAttribution: jofitz at ComputerMinds commentedTest-bot error, returning to RTBC.
Comment #23
alexpottCommitted and pushed 6ae744c to 8.4.x and 3115b5a to 8.3.x. Thanks!