Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
migration system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jan 2015 at 04:30 UTC
Updated:
4 Jul 2022 at 18:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
benjy commentedFail only patch attached. The problem is that $row->getDestinationProperty($this->getKey('id')) doesn't return the entity id for the base_field_override since the id is not in the incoming data but calculated from entity_type, bundle and field_name.
I've added a getEntityId() method to the Entity base class and then a base_field_override destination to override the new method.
Comment #2
benjy commentedArh, missing the new file.
Comment #5
ultimikeBenjy,
Do you think we need a comment in EntityBaseFieldOverride.php to explain that this class only exists for the test?
-mike
Comment #6
benjy commentedIt isn't only for the test. This same error happens when you migrate to Drupal 8 and already have a content type in your Drupal 6 site that exists in D8. For example, page and article.
Comment #7
ultimikeLooks good to me (thanks for the hint).
-mike
Comment #8
alexpottI'm not sure about this fix. Just using what is on the site that's being migrated to could be problematic. I think we need to report this to the user and ask them what to do... but this is a tricky issue.
Comment #9
benjy commentedBut now it has a valid entity id it tries to update what's on the site?
Comment #10
chx commented> Just using what is on the site that's being migrated to could be problematic.
So, we are not using that? It is loading and updating the entity if it exists. We have --independently of this issue-- discussed adding a flag called
delete_existingwhich would delete the entity if it exists. Would you like the patch better if that flag got added first?Comment #11
benjy commentedThis destination attempts to load the entity from D8 first and then update appropriately otherwise create a new one if it didn't exist. This is inline with the other destinations currently in core.
Note: We will have a "delete_existing" feature coming soon that allows the user to choose whether they want the destination to try update first or always starts a fresh.
Comment #12
alexpottMigrate is not subject to beta evaluation. Committed fcb679d and pushed to 8.0.x. Thanks!
Comment #15
sivarooban commentedhow to apply this patch