Problem/Motivation

Clicking on an image from a gallery displays the image but without the graceful layout of Colorbox, which prevents from using the navigation of Colorbox. No error in /admin/reports/dblog.

Steps to reproduce

composer update -W

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#5 composer.txt5.57 KBgillesbailleux

Comments

gillesbailleux created an issue. See original summary.

gillesbailleux’s picture

The bug is on a D11.3.2 dev instance, equipped with PHP 8.4.17: https://reinhardstein.bailleux.ovh/fr/agenda/castelflora

The bug might come from the formatter used in the views, which is implemented with the GridStack module.

jmaties’s picture

Have you installed the new library-fork?
drush colorbox:plugin

gillesbailleux’s picture

Performing the drush command displays the following:

user@server:~/public_html/web$ ../vendor/drush/drush/drush colorbox:plugin
 [notice] Colorbox is already present at /home/website/public_html/web/libraries/colorbox. No download required.
gillesbailleux’s picture

StatusFileSize
new5.57 KB

Here is the the composer.json file (in .txt format).

gillesbailleux’s picture

The composer.json file does not mention the ^2.2 release:
"drupal/colorbox": "^2.1"

gillesbailleux’s picture

Performing the composer require 'drupal/colorbox:^2.2' command now displays "drupal/colorbox": "^2.2" in the composer.json file.

paulmckibben’s picture

If you are using colorbox 2.2.x, you must use the new fork of the Colorbox library. The 2.2.x branch is not compatible with the legacy library. If you must use the legacy library, please stay on the 2.1.x branch.

Did you remove and replace your colorbox library?

Try deleting the entire web/libraries/colorbox directory, and then use the drush command to re-install it:
drush colorbox:plugin

gillesbailleux’s picture

The bug is not related to the gridstack formatter mentioned above as I created a node with the usual ColorBox Responsive formatter which does not display a Colorbox gallery: https://reinhardstein.bailleux.ovh/fr/colorbox-gallery

paulmckibben’s picture

@gillesbailluex When I use Chrome developer tools on your URL, I can see you are using the legacy Colorbox plugin, which is NOT compatible with the 2.2.x branch of the Colorbox module. Please either downgrade the Colorbox module to 2.1.x or delete and replace the colorbox library according to my earlier instructions.

gillesbailleux’s picture

Deleting the colorbox library and typing the drush command displays the following:

reinhardstein@server:~/public_html/web$ ../vendor/drush/drush/drush colorbox:plugin
 [error]  Error: Class "ZipArchive" not found in Drupal\colorbox\Commands\ColorboxCommands->download() (line 87 of /home/reinhardstein/public_html/web/modules/contrib/colorbox/src/Commands/ColorboxCommands.php) #0 [internal function]: Drupal\colorbox\Commands\ColorboxCommands->download()
#1 /home/reinhardstein/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#2 /home/reinhardstein/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#3 /home/reinhardstein/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#4 /home/reinhardstein/public_html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(389): Consolidation\AnnotatedCommand\CommandProcessor->process()
#5 /home/reinhardstein/public_html/vendor/symfony/console/Command/Command.php(341): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#6 /home/reinhardstein/public_html/vendor/symfony/console/Application.php(1102): Symfony\Component\Console\Command\Command->run()
#7 /home/reinhardstein/public_html/vendor/drush/drush/src/Application.php(201): Symfony\Component\Console\Application->doRunCommand()
#8 /home/reinhardstein/public_html/vendor/symfony/console/Application.php(356): Drush\Application->doRunCommand()
#9 /home/reinhardstein/public_html/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun()
#10 /home/reinhardstein/public_html/vendor/drush/drush/src/Runtime/Runtime.php(113): Symfony\Component\Console\Application->run()
#11 /home/reinhardstein/public_html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#12 /home/reinhardstein/public_html/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run()
#13 {main}. 
Error: Class "ZipArchive" not found in /home/reinhardstein/public_html/web/modules/contrib/colorbox/src/Commands/ColorboxCommands.php on line 87 #0 [internal function]: Drupal\colorbox\Commands\ColorboxCommands->download()
#1 /home/reinhardstein/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#2 /home/reinhardstein/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#3 /home/reinhardstein/public_html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#4 /home/reinhardstein/public_html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(389): Consolidation\AnnotatedCommand\CommandProcessor->process()
#5 /home/reinhardstein/public_html/vendor/symfony/console/Command/Command.php(341): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#6 /home/reinhardstein/public_html/vendor/symfony/console/Application.php(1102): Symfony\Component\Console\Command\Command->run()
#7 /home/reinhardstein/public_html/vendor/drush/drush/src/Application.php(201): Symfony\Component\Console\Application->doRunCommand()
#8 /home/reinhardstein/public_html/vendor/symfony/console/Application.php(356): Drush\Application->doRunCommand()
#9 /home/reinhardstein/public_html/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun()
#10 /home/reinhardstein/public_html/vendor/drush/drush/src/Runtime/Runtime.php(113): Symfony\Component\Console\Application->run()
#11 /home/reinhardstein/public_html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#12 /home/reinhardstein/public_html/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run()
#13 {main}
Error: Class "ZipArchive" not found in Drupal\colorbox\Commands\ColorboxCommands->download() (line 87 of /home/reinhardstein/public_html/web/modules/contrib/colorbox/src/Commands/ColorboxCommands.php).
 [warning] Drush command terminated abnormally.
reinhardstein@server:~/public_html/web$ cd sites/
reinhardstein@server:~/public_html/web/sites$ chmod u+w default
reinhardstein@server:~/public_html/web/sites$ cd ..
reinhardstein@server:~/public_html/web$ ../vendor/drush/drush/drush cr
 [success] Cache rebuild complete.
reinhardstein@server:~/public_html/web$ ../vendor/drush/drush/drush colorbox:plugin
 [notice] Colorbox is already present at /home/reinhardstein/public_html/web/libraries/colorbox. No download required.
reinhardstein@server:~/public_html/web$ 
paulmckibben’s picture

@gillesbailleux It looks like your server doesn't have php-zip installed.

You can also download and install the colorbox plugin manually according to the instructions in the README.md file.
You can download it from https://github.com/TurbojetTechnologies/colorbox/archive/master.zip

gillesbailleux’s picture

So the problem is that, after deleting the old Colorbox library and performing the drush colorbox:plugin command, there is a new colorbox folder in /public_html/web/libraries but this folder contains only one file: colorbox.zip

paulmckibben’s picture

@gillesbailleux, again, it sounds like your server does not have the required php-zip extension, and so it cannot unzip the file.

I suggest you delete the zip file and download the plugin manually from https://github.com/TurbojetTechnologies/colorbox/archive/master.zip

gillesbailleux’s picture

Unzipping the library fixed the issue! Awaiting more information from @didier-misson about the lack of php-zip lack on the server.

paulmckibben’s picture

Status: Active » Closed (works as designed)

Glad to hear you were able to make it work.

I have updated the project page to try and make it clearer that version 2.2.x requires you to update your colorbox plugin to the Turbojet fork.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

gillesbailleux’s picture

@paulmckibben: thank you very much for your time and patience solving this issue.

gillesbailleux’s picture

Update about #14 comment from @paulmckibben: I confirm that the required php-zip extension for PHP 8.4.x was NOT installed on the server (now the extension is installed).

kmonty’s picture

The 2.2.0 release probably should have had more complete upgrade notes and been a major release, not a minor, as this automatically broke installs.

It might be a good idea to start using composer rather than relying on Drush for installing dependencies. That would have saved some hassle.