Problem/Motivation
MigrateDestinationInterface::rollback() has a $destination_identifier parameter.
This is an array of ID values, which are keyed by the key names.
The documentation should say that the array is keyed.
Issue fork drupal-3247205
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
beatrizrodriguesI'll work on this
Comment #6
beatrizrodriguesI changed the documentation from MigrateDestinationInterface::rollback() parameter.
Comment #7
anagomes commentedComment #8
anagomes commentedThe documentation now states that the array is keyed, this solves the issue.
Comment #9
quietone commentedThanks for working on this. I think we can do better with that description. Saying that an array is keyed by key names seems self evident to me. And we can refer to the getIds, which will help the reader.
I think this is more informative.
Comment #10
joachim commentedHow about:
> The array keys are defined by the destination plugin's INTERFACE::getIds() method.
so the api docs make the link?
Comment #11
beatrizrodriguesI'm sorry, the description that I put is not good, indeed. Thank you for the comment with a better one :)
Comment #12
beatrizrodriguesComment #13
quietone commented@joachim, what do you think?
Comment #14
joachim commentedIt seems ok to me. The destination plugin is a thing. More specifically, it's an object, and being an object it has a class and methods.
If anything, I'd say that this:
> MigrateDestinationInterface::getIds() method used by the destination plugin.
isn't correct, as it makes it sound like getIds() is called BY the plugin. It's not, it's a method on the plugin. The plugin's method.
I guess I'll accept the distinction that the plugin is a concept and it happens to be implemented with a class... in which case, let's say:
> The array keys are defined by the destination plugin class's \Drupal\migrate\Plugin\MigrateDestinationInterface::getIds() method.
Or even stricter:
> The array keys are defined by the destination plugin class's implementation of \Drupal\migrate\Plugin\MigrateDestinationInterface::getIds().
What I do want to nitpick though is:
> * An associative array of destination IDs for the object that is being
I'd rather this said 'row' than 'object'.
Comment #15
quietone commentedIt appears that I learned the use of the possessive form different than you.
An associative array of destination IDs for the row that is being rolled back.To me that reads like the row is being rolled back when in really is something else.
Comment #16
joachim commented> It appears that I learned the use of the possessive form different than you.
Possibly! I'm not sure what you mean though. I thought your point was mostly about the plugin being a concept rather than the actual class.
> To me that reads like the row is being rolled back when in really is something else.
Yes, to me too. It is the row that is being rolled back, isn't it? I guess the command the user issued was to roll back the *migration*, but then each row is rolled back one by one. But I've just been to read existing docs, and:
so fair enough, let's keep 'object' to be consistent.
Comment #17
beatrizrodriguesThank you for the comments, I'm learning a lot with the discussion. But I couldn't be able to understand if
is the right form. I changed the last word to object, following the comment #16 where says
I would change the frist line object to row, as I agree with
So, I would do:
So we do not repeat the word object.
Tell me if I got something wrong, please. If it is fine I do the change to the MR.
Comment #18
beatrizrodriguesSo, i did the changes as I said in #17. Please let me know if something is wrong or could be better. Thank you.
Comment #19
lucienchalom commentedThis is the present documentation.
What I, as a nonnative speaker and without much context can understand, is that this array is of IDs for each row that will be rolled back by the rollback method. These IDs are from getIDs method and passed as the parameter to rollback().
If this is correct, we can move to RTBC.
Comment #20
quietone commentedI think this needs work.
The docbloc is now this:
The summary line states that the destination object is removed but the comment says the row is rolled back. That is contradictory. The summary line is correct in that it is the destination object that is rolled back (and the row removed).
Comment #21
joachim commented> The summary line is correct in that it is the destination object that is rolled back (and the row removed).
I would have said that we roll back a row, and when the row is rolled back, the destination object is deleted.
Comment #25
quietone commentedLet's get this done.
Comment #26
smustgrave commentedFairly confident this document update didn't break nightwatch
Comment #27
quietone commentedJust a rebase with not conflicts.
Comment #33
catchCommitted/pushed to 11.x and cherry-picked back through to 10.3.x, thanks!