Closed (fixed)
Project:
Drupal core
Version:
8.5.x-dev
Component:
migration system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Mar 2017 at 21:08 UTC
Updated:
25 Jan 2018 at 22:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jofitzThis one is also a bit tricky, but here's a start. I have added:
I couldn't identify destination properties the same as I did with #2862655: Add documentation to Config destination plugin and #2862751: Add documentation to PerComponentEntityDisplay destination plugin.
Comment #3
ohthehugemanatee commentedGreat start, and good examples.
* "the destination is for translations" is hard to understand. It would be clearer as "the destination will be associated with the langcode provided by the source plugin."
* I would remove the "signature/value" key from the second example entirely; it's just confusing and doesn't provide anything the mail and name keys don't already.
* "This will add the results of the process..." would be clearer as "This will migrate mapped data ("nid" and "uid") into a "user" entity". This change can apply to both descriptive sentences.
Comment #5
masipila commentedComment #6
masipila commentedI changed the example from a user migration to a node migration because we are demonstrating the overwrite_properties configuration key in the example and overwriting user account data is a bit too dangerous to be used as an example in my opinion.
The interdiff is included but does not make much sense as the example is changed.
Cheers,
Markus
Comment #8
quietone commentedI don't know about the 'dangers' of overwrite properties and the user migration but in changing the example, I think we have lost part of what is happening here. That is, what is happening to other properties provided by the source plugin and not listed in overwrite_properties. In that regard, we could use the d6_node source plugin and explain what happens to those properties. Still I have seen a fair number of questions about user migration and passwords. maybe it should be reverted? Not sure, I can be convinced either way.
Typo s/'/*/
Comment #9
masipila commentedMy concern on using the user migration as an example is this:
I do agree, however, that the user migration needs to be documented but we already have a handbook page for that purpose and that handbook page includes the password hashes, see https://www.drupal.org/docs/8/api/migrate-api/migrate-destination-entity...
I'll propose the following for this API documentation:
Patch will follow shortly.
Markus
Comment #10
masipila commentedHmm.. Continuing to think out loud regarding the user migration example.
I don't think that the user migration example belongs here to EntityContentBase destination plugin. We have a separate subclass EntityUser for migrating user entitities and that destination plugin has the capabilities for the password MD5 hashes.
I created a follow-up to improve the API documentation of EntityUser, see #2933310: Add documentation to EntityUser destination plugin.
Cheers,
Markus
Comment #11
masipila commentedChanges since #6: Added a third field which will be preserved in an update. Improved phrasing.
Comment #12
quietone commentedI like what your idea in #10, makes a lot more sense.
The patch reads well. I wondered about the key 'translations'. There isn't an example of it's use here, I found it on the parent class, Entity.php. That makes sense but maybe there should be a comment that an example of the usage of translations can be found in Entity.php, with a link to it? That way it will be easy to find. What do you think?
Comment #13
masipila commentedI added the translation to the example directly so that the developer doesn't have to jump back and forth but can get a comprehensive example from here (also changed the example values to Finnish).
I also re-phrased the text so that we don't 'hard code' the destination version to Drupal 8.
Markus
Comment #14
quietone commentedYes, good idea to change the reference from Drupal 8 to the destination site. This looks good to me now.
Comment #15
masipila commentedAdded a 'see also' reference to \Drupal\migrate\Plugin\migrate\destination\EntityRevision. See #2862748: Add documentation to EntityRevision destination plugin. These two patches should be preferably be committed at the same time.
Cheers,
Markus
EDIT: Fixed the correct issue number for EntityRevision.
Comment #16
masipila commentedComment #17
heddnIs this always overwritten, even if the update flag wasn't passed when running the migration?
Update: I see this is mentioned later. But can we work it into the initial short description too?
Might try using the embedded source plugin instead of empty.
Comment #18
harsha012 commentedimproved on the doc section.
Comment #19
heddn#18 doesn't see to address any of the feedback points in #17.
Comment #20
jofitzAddressed the feedback from #17 (ignoring the patch in #18).
Comment #21
heddnAll my feedback is addressed. On to RTBC.
Comment #22
masipila commentedLet's use the embedded_data source plugin instead of d7_node (see #17) so that we are providing a working stand-alone example. In addition to this, the patch #15 gave an explicit example on how the fields are overwritten on update because the source data was visible in the example.
I can take this on Friday if this hasn't been worked before that.
Markus
Comment #23
heddnComment #24
heddnComment #25
heddnComment #26
masipila commentedWorking on this now.
Comment #27
masipila commentedThe attached patch uses #15 as the basis and changes the source plugin to EmbeddedDataSource as heddn suggested in #17 (and fixes the typo Jo spotted in his patch + adds the claficication from Jo's patch).
Cheers,
Markus
Comment #28
heddnAll feedback is addressed. On to RTBC.
Comment #29
masipila commentedArgh. The previous patch is missing the
idspart of the embedded data source... fixing right now... sooorrry.Comment #30
masipila commentedAnd now it should be done.
Comment #31
heddnOops. Missed that. Now I think we are good to go.
Comment #33
gábor hojtsyLooks good, thanks all!