- Issue created by @candelas
- π¬π§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:
- Install Drupal [core version]
- Install colorbox [module version]
- Other configuration steps necessary to demonstrate colorbox is working
- Upgrade colorbox to [new version]
- 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!
- Status changed to Postponed: needs info
2 months ago 9:43pm 29 May 2025 - πΊπΈUnited States bsnodgrass
I just upgraded a site using Colorbox 2.0.2 to 2.1.4, the following error occurred in my local dev environment:
Fatal error: Cannot redeclare template_preprocess_colorbox_view_mode_formatter() (previously declared in /var/www/html/web/modules/contrib/colorbox/colorbox.theme.inc:278) in /var/www/html/web/modules/contrib/colorbox/colorbox.theme.inc on line 450
I will attempt to downgrade to 2.1.0 to see if this is resolved.
- πΊπΈUnited States bsnodgrass
I am fairly certain my error is site-specific. I removed my modules/contrib/ folder and reinstalled with composer. This resulted in the colorbox.theme.inc file matching what is in the source.
I suspect that something happened in my update process from 2.0.2 to 2.1.4