5.5.0-beta1 DivisionByZeroError: Modulo by zero

Created on 18 May 2024, about 1 month ago
Updated 22 May 2024, about 1 month ago

Problem/Motivation

Bumped up from 5.5.0-alpha1 to 5.5.0-beta1. Ran into an error on views-bootstrap-cards.html.twig

Steps to reproduce

Update to 5.5.0-beta1, add a Bootstrap Cards block to a page with some content, get the error.

Proposed resolution

It looks like the modulo on views-bootstrap-cards.html.twig is causing a `(key + 1) % 0` because there are columns present. I added this `{% if (key + 1) % ((columns == 0) == 0 ? 1 : (columns == 0)) %}` on line 35 and I believe it fixed it.

Remaining tasks

Confirm the fix is valid :-)

πŸ› Bug report
Status

Closed: works as designed

Version

5.5

Component

Cards

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @tylertech-lee-hazlett
  • πŸ‡ΊπŸ‡ΈUnited States shelane

    After upgrading, did you edit the view style settings and save it first, or did you go to the page the view is on first? If you did not edit and save, try that. If you still get the error, let me know.

  • πŸ‡ΊπŸ‡ΈUnited States bunthorne

    I had the same error, and followed the suggestion in #2. For each view that had Bootstrap Cards, I opened the Settings for the card, clicked on Apply, and then Save for the View. After completing that for each BS Cards view, the site was able to display again.

  • πŸ‡ΊπŸ‡ΈUnited States bunthorne

    But after this reset, I am getting php errors in the log:
    Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in template_preprocess_views_bootstrap_list_group() (line 245 of /[path]/web/modules/contrib/views_bootstrap/views_bootstrap.theme.inc)

  • πŸ‡ΊπŸ‡ΈUnited States shelane

    Are you using list group or are you getting errors stating list group for views using cards?

  • πŸ‡ΊπŸ‡ΈUnited States bunthorne

    It seems to be in the preview of the Bootstrap List Group view. Location for the one of the 5 error messages was:
    https://[sitename]/admin/structure/views/view/[viewname]/preview/page_1?_wrapper_format=drupal_ajax

  • Status changed to Closed: works as designed about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States shelane

    The list group issue was taken care of in another issue.

  • Sorry for the delay, I guess I need to update my notification settings. I will try the edit and save and follow up today.

Production build 0.69.0 2024