Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paragraph bundle not exported/imported #28

Closed
robertgarrigos opened this issue Dec 21, 2018 · 17 comments · Fixed by #68
Closed

paragraph bundle not exported/imported #28

robertgarrigos opened this issue Dec 21, 2018 · 17 comments · Fixed by #68
Labels
bug Something isn't working has pr Has a PR or branch for testing.
Milestone

Comments

@robertgarrigos
Copy link
Member

robertgarrigos commented Dec 21, 2018

I created a new paragraph bundle in a dev site, added a new field to it, checked that it was working and then exported the new configurations with drush bcex. Commited and pushed changes to my git repository and pulled from my staging site. Then imported the new configurations with drush bcim to the staging site and pargraph bundle was missing. Checked back again that config files were present, cleared cache a few times, but paragraph bundle was sill missing.

Finally, I just created manually the paragraph bundle with the same machine name and voilà! it appeared again with its field. Wondering why...

@laryn
Copy link
Member

laryn commented Jan 3, 2019

@robertgarrigos Interesting! Any ideas? @serundeputy can I drag you into this one for input?

@serundeputy
Copy link
Member

I'd create a paragraph bundle on a dev site and import the config via Backdrop UI (sans drush) and see if the config takes.

  • If so I'd say file this bug in the drush queue

  • if not i'd say the paragraphs module is not creating all the config necessary to do its job

@laryn
Copy link
Member

laryn commented Jan 3, 2019

Thanks @serundeputy!

@robertgarrigos can you try the above and let me know the result?

@robertgarrigos
Copy link
Member Author

robertgarrigos commented Jan 9, 2019

Right, I'm having different issues with config import/export. I have two "gited" blank local sites (with lando, backdrop1 and backdrop2), with paragraph enabled on both (default profile), create one bundle (in backdrop1 only) and add it a bundle field (text). Then:

drush

drush export config and git push on backdrop1, git pull and drush import on backdrop2. Results: the bundle paragraph is not created. BUT: you can create a bundle with the same name and you get the bundle WITH the bundle text field listed in it. HOWEVER: it's a ghost field. It shows as created in the bundle but when you go to delete it, you get an error about a missing table for that bundle field. Thus, the bundle field is listed but not created.

web

export config on backdrop1 with web form and import it on backdrop2 with web form. The bundle doesn't get created and if you create it again with the same name, as before, the bundle field doesn't show listed, nor it is created either.

@serundeputy
Copy link
Member

Seems a but with paragraphs not exporting all the field definitions to config; needs a field config and field instance at least i think.

Have not looked at this code, but seems like the bug is a paragraphs bug.

@serundeputy serundeputy added the bug Something isn't working label Jan 9, 2019
@mazzech
Copy link

mazzech commented Nov 17, 2019

I can confirm that... still no paragraph bundles in export. Just compared a export of "body field" with export "paragraphs body field" (created separately), there is no mention of an Entity Type.
Screenshot 2019-11-17 at 12 36 03

@laryn
Copy link
Member

laryn commented Nov 22, 2019

@serundeputy If you have a second to gander at these lines -- is this our problem on this issue?
https://github.com/backdrop-contrib/paragraphs/blob/1.x-1.x/ParagraphsItemEntity.inc#L491-L506

@robertgarrigos
Copy link
Member Author

robertgarrigos commented Jul 26, 2020

@laryn I don't think this export() method is ever called. There is not such a method in entity.class (its parent).

@robertgarrigos
Copy link
Member Author

I believe this bug is triggered due to the lack of any hook_config_* functions in paragraphs. Am I right??

@robertgarrigos
Copy link
Member Author

I think this would be fixed by implementing the hook_config_create function (maybe also the update one) which should trigger paragraphs_save_bundle() function, as the only thing missing in the backdrop install is the entry of the bundle in the paragraphs_bundle table in ddbb.

@laryn
Copy link
Member

laryn commented Jul 26, 2020

@robertgarrigos Could this also be related to the fact that Paragraph bundles/types haven't (yet) been converted to CMI in the same way that content types were in core?
#46

Your concept sounds worth testing -- but I won't have time to create a PR in the near future. If you are able sooner I will definitely test.

@robertgarrigos
Copy link
Member Author

Once this PR (#66) is merged I will fix this issue, as it does much more sense to have paragraphs bundles as CMI before.

@laryn
Copy link
Member

laryn commented Jul 29, 2020

@robertgarrigos I've merged your bundles -> CMI PR. Thanks for that! Happy to also review any PRs here if/when you get to it.

@ghost
Copy link

ghost commented Aug 24, 2020

I experienced this problem where a Paragraphs bundle wasn't appearing on a new site after importing config. After reading the above, I updated to the latest dev version of this module which has the CMI patch. That allowed the Paragraphs bundle to get exported from the old site, which wasn't happeneing previously.

Then, when I tried importing it to the new site, I got an error about no module owning that file. Some research turned up the need for modules to implement hook_config_info(), so I did that for Paragraphs and it worked. Paragraphs bundle was imported and works nicely.

@laryn Here's a PR: #68

@ghost ghost added the has pr Has a PR or branch for testing. label Aug 24, 2020
@laryn
Copy link
Member

laryn commented Aug 24, 2020

Thanks @BWPanda -- one minor comment in the PR.

@ghost
Copy link

ghost commented Aug 24, 2020

@laryn Cool, PR updated.

@laryn
Copy link
Member

laryn commented Sep 1, 2020

Thanks @BWPanda !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has pr Has a PR or branch for testing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants