Open reshmaneerukonda opened 6 years ago
This module is designed as a bridge between entity_pilot and entity_reference_revisions (the module which provides the field types for paragraphs). It doesn't belong in the entity_pilot module as it is specific to the err module.
This module exports and imports paragraphs via uuids, can you provide some more information and a small sample manifest to test with? Have you tried debugging into the ParagraphNormalizer::denormalize function to see what is going wrong?
Thanks for the quick response. Attached the paragraph json extract. The first file containing the initial paragraph and the second file containing the changes paragraph_first.txt paragraph_second_withchanges.txt
I am debugging ParagraphNormalizer::denormalize function. I will let you know the results.
Did the new manifest also contain the paragraph uuid? The files look fine to me, they contain the same uuids for the parent too.
"paragraph": { "transaction_tab_content": [ "1b35582b-a601-439b-9d82-18912605e362" ], "transaction_introduction_tabs": [ "7f393b06-86b2-4b3c-a6e9-0a2405da4a98" ] },
The paragraph uuid are contained in the manifest.
In ParagraphNormalizer::denormalize, the $data['parent_id'][$key]['value'] is not getting set for the first time. It is not going into any of the if statetments if ($entity = $this->unsavedUuid->resolve($this->uuidReference, $uuid, $entity_type_id)) nor if ($entity = $this->entityManager->loadEntityByUuid($entity_type_id, $value['target_uuid'])) {
When importing the content second time, it is setting $data['parent_id'][$key]['value'] with correct entity->id();
Also, was thinking whether we need to add ParagraphDependencySubscriber implementing EventSubcriberInterface similar to BookDependencySubscriber class in entity_pilot.
@reshmaneerukonda that sounds correct. The first time it will be importing it as a new entity. Those if statements are trying to find existing entities to overwrite. I'm not sure we need the event subscriber. When I wrote this module it worked without it so I'm not sure what has changed since in order for it to stop working. Is it broken for all paragraphs or just some?
@acbramley: It is broken for all paragraphs. It works for the first time with a fresh database. However, whenever it tries to import on the existing site with entity_pilot_import, any paragraph changes are not getting reflected on the site. No error is thrown.
As a workaround, we are trying to respin the preview site from code, everytime any changes are made to paragraph.
@acbramley: Finally got it working by making changes to paragraphs denormalize method and EntityPilotErrServiceProvider. Could you please provide access to this repository, so I can push these changes to a new branch (8.x-2.x)
@reshmaneerukonda please fork the repository and provide a pull request so I can review it. Thanks!
@acbramley: This issue still exists. It is all related to revision ids of paragraphs. The first time, it works since there will be only one revision exits for paragraph item. The second time when I import the manifest, it is creating additional revisions and they are not getting mapped correctly.
In EntityReferenceRevisionItemNormalizer, constructValue method it is returning an entity which is having the initial value...(with old revision number). $entity = $this->entityResolver->resolve($this, $data, $target_type)
@reshmaneerukonda I understand, but you'll need to create a pull request in order for me to review your code changes and merge them into the repository. Please follow https://gist.github.com/Chaser324/ce0505fbed06b947d962 to create a fork and pull request :)
@acbramley: It is now picking the correct revision item of a paragraph, however, the parent id is not getting set correctly during denormalization. Created a pull request: https://github.com/acbramley/entity_pilot_err/pull/3
@acbramley I have taken over this issue from @reshmaneerukonda. I found out that when I imported content using Entity Pilot (structure->entity-pilot->arrivals), import worked fine and correct values appeared in the database (screenshot attached
Note: First row in the screenshots is a result of creation of paragraph and next 2 rows are result of import.
correct-database-values.png
incorrect-database-values.png
Background: Changes made to paragraphs in author site are not getting published to preview site.
Changes in the paragraph are not getting imported to the site. The first time, with the new database on the site the import of paragraphs work. Next time when we try to import the paragraphs from a manifest file containing paragraph json file, they are not imported to the site. No errors are thrown.
Modules used : entity_pilot, entity_pilot_git and entity_pilot_err
Could you please shed light on this entity_pilot_err module and can this be converted as a patch for entity_pilot.