Problem/Motivation

After upgrading to varbase 9.0.16, it looks like there are some issues with the column styles. It looks like the column classes are not getting added.

Steps to reproduce

  1. Create a new page with paragraphs enabled
  2. Add two uneven columns
  3. Add two wrappers
  4. Set column styles
  5. See error

Proposed resolution

Remaining tasks

  • ✅ File an issue about this project
  • ✅ Addition/Change/Update/Fix to this project
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support on feature change/addition
  • ➖ User Guide Documentation support on feature change/addition
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ✅ Code review from 1 Varbase core team member
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Review with the product owner
  • ✅ Update Release Notes and Update Helper on new feature change/addition
  • ✅ Release varbase-9.0.17, varbase_bootstrap_paragraphs-9.0.16

Varbase update type

  • ✅ No Update
  • ➖ Optional Update
  • ➖ Forced Update
  • ➖ Forced Update if Unchanged

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • Issue #3394665 by jedgar1mx: Fixed Broken and deprecated twig templates on for loops and limited the 9.0.x branch to Drupal ~9.0 only

Comments

jedgar1mx created an issue. See original summary.

jedgar1mx’s picture

Issue summary: View changes
jedgar1mx’s picture

StatusFileSize
new8.79 KB

Looks like the issue is with the key - item loops. They were split into a `for` and `if` statements which cause some weird behaviors. Probably caused by some linting tool since this affected all twig templates.

jedgar1mx’s picture

StatusFileSize
new8.98 KB

I think this was caused by trying to automate Drupal 10 fixes for deprecated twig templates on for loops. I updated the patch to match the new syntax.

jedgar1mx’s picture

Title: Column styles not working » Broken "For" loops
rajab natshah’s picture

Title: Broken "For" loops » Fix Broken and deprecated twig templates on for loops
Assigned: Unassigned » rajab natshah
Status: Active » Needs review

Thank you, Edgar, for reporting and patching.

Testing, and will have a commit and quick fix release for this issue.

rajab natshah’s picture

Status: Needs review » Active

  • Rajab Natshah committed cca5908a on 10.0.x
    Revert Issue #3394665: Fix Broken and deprecated twig templates on for...

rajab natshah’s picture

Title: Fix Broken and deprecated twig templates on for loops » Fix Broken and deprecated twig templates on for loops and limit the 9.0.x branch to Drupal ~9.0 only
rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Issue summary: View changes
Status: Active » Needs review
Issue tags: +varbase-9.0.17, +varbase_bootstrap_paragraphs-9.0.16
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

rajab natshah’s picture

Issue summary: View changes
stefan.korn’s picture

I suppose patch from #4 should have been used as the base for the change, but instead patch from #3 was used.

The bottom line is that there was conditional filtering in the for loop which has been deprecated with Twig 3. Patch from #3 removed the conditional filtering and moved the if condition in the for loop, but this breaks the bootstrap because loop.first is not correct then. Instead with patch from #4 the conditional filtering is Twig 3 (and Twig 2.10) compatible as it uses twig filter.

So the current state of the module is:

9.0 is back to old conditional filtering with if in the for loop, which is only Twig 2 compatible

9.1 and 10 are not using conditional filtering anymore (putting the if inside the for loop) and thus breaking the functionality. So for 9.1 and 10 this should be changed to use the TWIG filter instead as proposed with patch from #4.

rajab natshah’s picture

stefan.korn’s picture

Hm, at least for carousel this does not work as expected I suppose:

https://git.drupalcode.org/project/varbase_bootstrap_paragraphs/-/blob/9...

loop.first is not reached, therefore no item is active initially and the carousel does not show.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rajab natshah’s picture

Issue summary: View changes

✅ Released varbase-9.0.17

rajab natshah’s picture

Issue summary: View changes