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.
A patch was made to add dragabble classes for Paragraph items on the back end. This was merged up and closed and after closing, a patch was added to fix an issue with 'Undefined index: #bundle', which was never merged in, I assume due to the issue being closed.
On top of that, that patch fails in PHP 7.1.0, so this patch includes both fixes, and in a new issue that hopefully will get noticed and merged.
Comment | File | Size | Author |
---|---|---|---|
#7 | paragraphs-add-bundle-php7-3010369-7.patch | 872 bytes | dhirendra.mishra |
Comments
Comment #2
ChrisDarke CreditAttribution: ChrisDarke at Hook 42 for Zicasso, Inc. commentedHere is the patch that encapsulates the fixes required. Testing on PHP7.1 should result in no issues or warnings with multiple paragraph instances on the edit form.
Comment #3
ChrisDarke CreditAttribution: ChrisDarke at Hook 42 commentedComment #4
oadaeh CreditAttribution: oadaeh at Hook 42 commentedThe patch looks good and fixes the problem (and the tests pass).
Comment #5
miro_dietikerI would prefer to initialize a $class variable, set it conditionally and use it here. The ternary operator seems to be a bit too long to remain readable.
Comment #6
dhirendra.mishra CreditAttribution: dhirendra.mishra at Srijan | A Material+ Company commentedlet me do that.
Comment #7
dhirendra.mishra CreditAttribution: dhirendra.mishra at Srijan | A Material+ Company commentedHere is the patch.
Comment #8
sickness29 CreditAttribution: sickness29 at DevBranch commentedRe-roll of the patch above for 1.0-rc5 release.
Comment #10
sickness29 CreditAttribution: sickness29 at DevBranch commentedComment #11
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commentedsickness29, generally, it isn't necessary to post patches against a tag. Development happens on a dev branch. If you need to use the patch on a site you can probably download the latest dev and apply the issue's patch against that. If, for some reason, you find it necessary to post a patch against a tag rather than the latest dev then your patch should be marked "Do not test" before you upload it so that the test bot doesn't test it against the latest dev, find that it doesn't apply, and incorrectly mark the issue "Needs work".
Can you review #7 to make sure it works and report if it includes the suggestion recommended in #5?
Comment #12
iStryker CreditAttribution: iStryker commentedWe are getting the following error. Notice: Undefined index: #bundle in theme_paragraphs_field_multiple_value_form() (line 1176 of /var/www/.../modules/contrib/paragraphs/paragraphs.module).
I believe this way with PHP 5.x for us. It is when we upload multiple values (images). I like patch in #2542066: Add paragraphs bundle class to row in backend, but it should be can be cleaned up.
Comment #13
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commentediStryker, I assume you get the notice without applying the patch. Have you tried the patch yet?
Comment #14
iStryker CreditAttribution: iStryker commentedYes. Here is it is like #2542066: Add paragraphs bundle class to row in backend with array short-handlers.
Comment #16
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commented#7 is still the preferred patch because #14 uses short array syntax which wasn't introduced until PHP 5.4.
#7 still needs to be reviewed. Once it has been reviewed the status of this issue can be changed to "Reviewed and tested by the community".
Comment #17
iStryker CreditAttribution: iStryker commentedhttps://www.drupal.org/files/issues/2018-10-30/paragraphs-add-bundle-cla... from #2542066: Add paragraphs bundle class to row in backend applies cleanly and fixes the problem
Comment #18
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commentedThe followups in #2542066: Add paragraphs bundle class to row in backend should have been in a separate issue. We now have this issue to serve that purpose. #5 in this issue has requested that the class be stored in a variable before insertion into the array. #7 does that. #17 does not. Therefore, #7 is still the preferred patch. We still need a review of #7.
Comment #19
iStryker CreditAttribution: iStryker commentedOk #1 and #17 is the same patch. I still think 1 line is better. It is common practice with form elements to have a one-liner if statement. Happens all the time with default values. Maintainer wants to create a variable, so let him create an extra variable. #7 is good. Marking RBTC!
Comment #20
joegraduateComment #21
firewaller CreditAttribution: firewaller commented#7 works for me.
Comment #22
DamienMcKennaComment #23
DamienMcKennaComment #24
DamienMcKennaComment #26
miro_dietiker@jstoller committed and still RTBC?
EDIT: I also see that this applies to multiple other 7.x issues. Please check their status.
Comment #27
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commented@miro_dietiker, it looks fixed to me. What other issues have bearing here?
Comment #28
miro_dietiker@jacob.embree The issue status is still RTBC and not updated to Fixed.
Comment #29
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commentedYeah, that looks like an oversight, so I'll go ahead correct the status.
Comment #30
jstollerSorry for the confusion. I had to run out the door right after pushing my commits last night. I'm updating issue statuses now.
Comment #31
miro_dietiker@jstoller Perfect, thank you. Also @jacob.embree.
Comment #32
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commented