Giter Site home page Giter Site logo

Comments (14)

acbramley avatar acbramley commented on July 20, 2024

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?

from entity_pilot_err.

reshmaneerukonda avatar reshmaneerukonda commented on July 20, 2024

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.

from entity_pilot_err.

acbramley avatar acbramley commented on July 20, 2024

Did the new manifest also contain the paragraph uuid? The files look fine to me, they contain the same uuids for the parent too.

from entity_pilot_err.

reshmaneerukonda avatar reshmaneerukonda commented on July 20, 2024

"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.

from entity_pilot_err.

reshmaneerukonda avatar reshmaneerukonda commented on July 20, 2024

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();

from entity_pilot_err.

reshmaneerukonda avatar reshmaneerukonda commented on July 20, 2024

Also, was thinking whether we need to add ParagraphDependencySubscriber implementing EventSubcriberInterface similar to BookDependencySubscriber class in entity_pilot.

from entity_pilot_err.

acbramley avatar acbramley commented on July 20, 2024

@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?

from entity_pilot_err.

reshmaneerukonda avatar reshmaneerukonda commented on July 20, 2024

@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.

from entity_pilot_err.

reshmaneerukonda avatar reshmaneerukonda commented on July 20, 2024

@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)

from entity_pilot_err.

acbramley avatar acbramley commented on July 20, 2024

@reshmaneerukonda please fork the repository and provide a pull request so I can review it. Thanks!

from entity_pilot_err.

reshmaneerukonda avatar reshmaneerukonda commented on July 20, 2024

@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)

from entity_pilot_err.

acbramley avatar acbramley commented on July 20, 2024

@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 :)

from entity_pilot_err.

reshmaneerukonda avatar reshmaneerukonda commented on July 20, 2024

@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: #3

from entity_pilot_err.

amitsharmadoj avatar amitsharmadoj commented on July 20, 2024

@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<correct-database-values.png>) but when I imported content using Enitity Pilot Git (running import-content.sh from command line), import didn't happen correctly and I could see why because of incorrect values in the database (screenshot attached<incorrect-database-values.png>). I am not sure why the incorrect value is being inserted in the 'field_tab_title_value' column of 3rd row. Any suggestions are appreciated.

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
correct-database-values

incorrect-database-values.png
incorrect-database-values

from entity_pilot_err.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.