Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With most designs, paragraphs have a header above them. We should add this into each type. If users don't want to use, the code should not show up.
Comment | File | Size | Author |
---|---|---|---|
#19 | add_headers_to_each_paragraph_3040370_19.patch | 22.25 KB | brooke_heaton |
#4 | Screen Shot 2019-03-28 at 4.58.58 PM.png | 79.21 KB | mluzitano |
#4 | Screen Shot 2019-03-28 at 4.58.22 PM.png | 39.7 KB | mluzitano |
#4 | Screen Shot 2019-03-28 at 4.57.18 PM.png | 74.71 KB | mluzitano |
#3 | bootstrap_paragraphs-add-header-3040370-3.patch | 56.84 KB | thejimbirch |
Issue fork bootstrap_paragraphs-3040370
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedIn progress
Comment #3
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedAttached is a big patch that:
Some steps to validate updating:
Install dev version of Bootstrap Paragraphs (composer require drupal/bootstrap_paragraphs:2.x-dev)
Enable the module
Follow configuration instructions in README.md
Apply patch
Run updb or visit /update.php
Add some paragraphs and see they have the Header field in the form but not the display.
To validate a new install, apply the patch before enabling
Comment #4
mluzitano CreditAttribution: mluzitano at Kanopi Studios commentedThis is working as expected for me. See the attached screenshots noting the field existing in the Accordion, Blank, and Columns (Two Uneven) as examples.
Comment #6
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedFixed in dev, thanks!
Comment #7
Jorge Navarro CreditAttribution: Jorge Navarro commentedI get this error after updating db
Comment #8
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commented@Jorge Navarro Do you have the Modal Paragraph type? Or did you delete it?
Comment #9
Jorge Navarro CreditAttribution: Jorge Navarro commentedYes, deleted, ok! I've bypassed the error... maybe it should check if exists so the update does not abort.
Comment #10
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedI will definitely take that into account for the next update hook I have to write, thanks!
Comment #12
brooke_heaton CreditAttribution: brooke_heaton commentedGetting this same error.
Error Output:
================
> [notice] Update started: bootstrap_paragraphs_update_8204
> [error] Missing bundle entity, entity type paragraphs_type, entity id bp_accordion.
> [error] Update failed: bootstrap_paragraphs_update_8204
> [notice] Message: Created snippet file based on configuration.
Comment #13
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commented@brooke_heaton Do you have a paragraph bundle with the machine name bp_accordion?
Comment #14
johnnydarkko CreditAttribution: johnnydarkko at Sage Tree Solutions commented@thejimbirch - Working with @brooke_heaton on this one...
There is no paragraph bundle with the machine name bp_accordion.
This error pops up in the watchdog log twice:
Comment #15
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commented@johnnydarkko. Do you have an accordion with another machine name? Or did you guys delete it?
What update 8204 did was look through the Paragraph bundles and add the bp_header field.
Since the update only needs to run once, you could remove those lines from the install file, and then add them back after the update has run.
See:
https://git.drupalcode.org/project/bootstrap_paragraphs/blob/3233d60f04c...
Comment #16
brooke_heaton CreditAttribution: brooke_heaton commentedProbably best to fix the update hook and patch. This is unfortunate.
Comment #17
brooke_heaton CreditAttribution: brooke_heaton commentedThe attached patch performs an EntityQuery on each Bootstrap Paragraph bundle that comes with the optional config and only attempts to add headers to existing entities. Because the Dev versions update made the broad assumption that paragraphs of each time exist, this resulted in continual unnecessary update failures. This patch ensures that only existing entities are updated.
Comment #18
brooke_heaton CreditAttribution: brooke_heaton commentedUpdated patch to make message reflect only the bundles updated - only bundles with entities will be updated.
Comment #19
brooke_heaton CreditAttribution: brooke_heaton commentedPolished up the message a bit.
Comment #20
snable CreditAttribution: snable as a volunteer and at 42robots commentedI am not totally sure if this is directly related to the patch but when i import config (add_headers_to_each_paragraph_3040370_19.patch already applied) i get:[error] A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: paragraph, bundle: bp_modal, field name: bp_headerFixed the above by reimporting database and cleaning up -
However, after trying to update translatable content in a multilanguage setup i get the following error:
InvalidArgumentException: Invalid translation language (en) specified. in Drupal\Core\Entity\ContentEntityBase->getTranslation() (Zeile 873 in /var/www/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php).
This is related to all new (and by default empty) header fields added to existing entities after applying the patch. This happens only on saving the secondary language (in my case "en"). This results in a fatal error.
Can anyone reproduce that error?
Best
Comment #21
snable CreditAttribution: snable as a volunteer and at 42robots commentedI digged a little deeper and must confirm that the error reported in my last comment is not directly connected to the issue.
It looks like this is deeper within paragraphs itself possibly related to the unsupported translation in paragraph fields.
Comment #22
rovo@brooke_heaton patch from #19 resolved my 8204 error.
Comment #23
twills CreditAttribution: twills at Kanopi Studios commentedPatch from comment #19 applied successfully!
Comment #24
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedPatch no longer applies.
Comment #25
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commented