Fatal error: updating from Colorbox 2.0.2 to 2.1.1

Created on 20 September 2024, 7 months ago

hello and thanks for the module

Problem/Motivation

i am updating from 2.0.2 to 2.1.1 with Drupal 10.3.5. When I go to a page that has Colorbox, i get this error and can't see the page.

Fatal error: Cannot redeclare template_preprocess_colorbox_view_mode_formatter() (previously declared in /var/www/html/test.devel/web/modules/contrib/colorbox/colorbox.theme.inc:278) in /var/www/html/test.devel/web/modules/contrib/colorbox/colorbox.theme.inc on line 510

i downgraded to 2.1.0 and the problem is gone.

Steps to reproduce

in a content type, have a image that will use Colorbox to display.
update the module
any page gets the error.
downgrade and everything works

thanks for the module and have a good day :)

πŸ› Bug report
Status

Active

Version

2.1

Component

User interface

Created by

πŸ‡ͺπŸ‡ΈSpain candelas

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

Comments & Activities

  • Issue created by @candelas
  • πŸ‡­πŸ‡ΊHungary mr.york Hungary
  • πŸ‡¬πŸ‡§United Kingdom steven jones

    This sounds like something very specific to your environment has gone awry here.

    Looking at the module code:

    https://git.drupalcode.org/project/colorbox/-/blob/2.1.1/colorbox.theme....

    There's only one instance of the template_preprocess_colorbox_view_mode_formatter declared, and it's on line 278.
    In fact, there isn't even a line 510 in any of the versions mentioned in your OP: 2.0.2, 2.1.0, 2.1.1.

    Is it possible you have modified the code since it was downloaded from Drupal.org?
    Or maybe your version of PHP is caching some older version of the code while trying to include the new one too.

  • πŸ‡ΊπŸ‡ΈUnited States paulmckibben Atlanta, GA

    Reducing priority and changing to support request for now.

    @candelas and @mr.york, if you can provide a reliable set of steps on a clean installation of Drupal to reproduce the issue, starting with:

    1. Install Drupal [core version]
    2. Install colorbox [module version]
    3. Other configuration steps necessary to demonstrate colorbox is working
    4. Upgrade colorbox to [new version]
    5. Show that the same steps that worked before don't work any more.

    If you can provide those steps and I can reproduce the issue, I'll be glad to help. Thanks!

Production build 0.71.5 2024