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 SkipOnEmpty process plugin.
Comment | File | Size | Author |
---|---|---|---|
#28 | interdiff-25-28.txt | 1.01 KB | jofitz |
#28 | 2845488-28.patch | 3.83 KB | jofitz |
#25 | interdiff-24-25.txt | 616 bytes | jofitz |
#25 | interdiff-17-25.txt | 2.23 KB | jofitz |
#25 | 2845488-25.patch | 3.92 KB | jofitz |
Comments
Comment #2
quietone CreditAttribution: quietone as a volunteer commentedComment #3
phenaproximaSelf-assigning for review.
Comment #5
phenaproximas/source/input. And let's drop "evaluates to" and just change that to "is".
Should be "(empty string, NULL, FALSE, 0, '0', or an empty array)".
This should be reformulated as a listing of available configuration options. The only option this plugin exposes, AFAIK, is "method", so let's turn this into a cohesive description of that one option.
Let's delete this.
Add a couple of sentences here describing what the effect of this code will be.
Delete this.
Again, these examples should explain themselves afterwards.
This is not accurate. The method actually throws a MigrateSkipRowException if the value is empty -- this should be documented.
Need to document the reason why the exception is thrown.
As with row(), this needs to be more specific.
Needs to document the reason why the exception is thrown.
Comment #6
gerzenstl CreditAttribution: gerzenstl at 42mate commentedComment #7
gerzenstl CreditAttribution: gerzenstl at 42mate commented@phenaproxima, point #11 of your suggested changes cannot be added for the moment, MigrateSkipProcessException() extends from Exception class but currently is an empty class. Maybe the only thing we can mention about this exception is "This exception is thrown when the rest of the process should be skipped."
Comment #8
phenaproximaMost exception classes are empty subclasses of Exception. :) It should simply say "thrown if the source property is not set" or something like that.
Comment #9
gerzenstl CreditAttribution: gerzenstl at 42mate commentedI agree, comments added.
Comment #10
phenaproximaThank you, @gerzenstl. Great work :) There are a couple of nitpicks, but also some more serious problems that need to be addressed (by a maintainer or at least an experienced Migrate developer, so no worries if you don't want to tackle these).
This line exceeds 80 characters.
Exceeds 80 characters.
Let's get rid of this, it just confuses the example.
Can we change "skips the row process" to "skips the entire row"?
wat. This is confusing...and I'm not sure it's accurate, either. Surely, if the processing is skipped on empty, the migration plugin will not run..?!
Both of these examples need a further comment explaining what will happen in each case, assuming it's different than the example above. Otherwise, can remove them both.
Comment #11
phenaproxima"Useful when migrating parent values, there is no need to set a destination value." I don't understand what this means. I think we either need to clarify it, or strike it entirely.
Comment #12
xjmComment #13
jofitz CreditAttribution: jofitz at ComputerMinds commentedDocumentation tweaks in response to #10/11.
Comment #14
phenaproximaThe latest patch includes the changes to the Concat plugin. I think we need to reroll without those :)
Comment #15
jofitz CreditAttribution: jofitz at ComputerMinds commentedGot my git branches confused! The less said about that the better.
Comment #16
phenaproximaThe call to the migration plugin here is incorrect. It should be removed entirely. Should be:
Let's rephrase this. "If parent is empty, any further processing of the property is skipped. In this example, if parent is empty, the next plugin (migration) will not be run."
This is too long. It should just be "Skips the current row when value is not set."
This function doesn't return anything.
Nit: the indentation should be consistent. And let's get rid of "by default records with STATUS_IGNORED status in the map", it makes no sense.
Too long. Should be "Stops processing the current property when value is not set."
This method has no return value.
Nit: inconsistent indentation.
Comment #17
jofitz CreditAttribution: jofitz at ComputerMinds commentedI have addressed 1, 2, 3, 5, 6, 8 form #16 (and another inconsistent indentation not mentioned), but disagree with 4 & 7 - in both cases if $value is 'falsey' then the input value will be returned, i.e. there is a return value. I have edited the documentation to reflect this.
Comment #19
mikeryanComment #20
mikeryanContents of parent: need another level of indentation.
This paragraph sounds a bit redundant. Maybe something like "If parent is empty, any further processing of the property is skipped - thus, the next plugin (migration) will not be run."
I don't see any usage of "falsey" in core - let's just use "empty".
s/source property/the source property/, s/row/the row/ - articles help!
Since there's no way to record anything other than STATUS_IGNORED, I'd omit "by default".
Articles!
Thanks!
Comment #21
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedComment #22
Pavan B S CreditAttribution: Pavan B S at Valuebound commentedLine is exceeding 80 characters
Comment #23
jofitz CreditAttribution: jofitz at ComputerMinds commentedWell that's half the job...
Still need to address #20.1, #20.2 & #20.5.
Comment #24
yogeshmpawarChanges done as per suggestions in #20 & also added a interdiff.
Comment #25
jofitz CreditAttribution: jofitz at ComputerMinds commentedLet's push this one over the line.
Comment #26
phenaproximaSelf-assigning for review.
Comment #27
phenaproximaWhoa, this indentation is pretty wonky. The documentation for method should be flush with the word "Available". Also, "level of skip" should be "What to do if the input value is empty. Possible values:"
I'd prefer to remove the mention of the migration process plugin here. It's out of scope.
Should be "Prevents further processing of the input property when the value is empty".
Comment #28
jofitz CreditAttribution: jofitz at ComputerMinds commentedFixed errors identified in #27.
Comment #29
phenaproximaHell yeah!
Comment #30
alexpottCommitted and pushed fed0b7d to 8.4.x and 3e272aa to 8.3.x. Thanks!
Comment #34
rajeevku CreditAttribution: rajeevku commented