Closed robertgarrigos closed 4 years ago
@robertgarrigos Interesting! Any ideas? @serundeputy can I drag you into this one for input?
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
Thanks @serundeputy!
@robertgarrigos can you try the above and let me know the result?
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 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.
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.
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.
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.
@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
@laryn I don't think this export() method is ever called. There is not such a method in entity.class (its parent).
I believe this bug is triggered due to the lack of any hookconfig* functions in paragraphs. Am I right??
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.
@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? https://github.com/backdrop-contrib/paragraphs/issues/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.
Once this PR (https://github.com/backdrop-contrib/paragraphs/pull/66) is merged I will fix this issue, as it does much more sense to have paragraphs bundles as CMI before.
@robertgarrigos I've merged your bundles -> CMI PR. Thanks for that! Happy to also review any PRs here if/when you get to it.
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: https://github.com/backdrop-contrib/paragraphs/pull/68
Thanks @BWPanda -- one minor comment in the PR.
@laryn Cool, PR updated.
Thanks @BWPanda !
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 withdrush 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...