Drupal 10 compatibility

Created on 14 February 2023, almost 2 years ago
Updated 17 September 2024, 2 months ago

Problem/Motivation

Currently, Field Slideshow only supports Drupal 8 and 9. A Drupal 10 compatible version is required, as Drupal 9 reaches EOL in November 2023.

Upgrade_status lists 3 issues:

$ drush upgrade_status:analyze field_slideshow
 [notice] Processing /home/awardsun/drupal9/web/modules/contrib/field_slideshow.

================================================================================
Field Slideshow,  8.x-3.0-beta2
Scanned on Wed, 03/22/2023 - 22:00

FILE:
web/modules/contrib/field_slideshow/src/Plugin/Field/FieldFormatter/FieldSlidesh
ow.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 505  Call to deprecated function file_create_url(). Deprecated in
                    drupal:9.3.0 and is removed from drupal:10.0.0. Use the     
                    appropriate method on                                       
                    \Drupal\Core\File\FileUrlGeneratorInterface instead.        
--------------------------------------------------------------------------------

FILE: web/modules/contrib/field_slideshow/field_slideshow.libraries.yml

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 0    The 'field_slideshow.cycle2' library is depending on a      
                    deprecated library. The core/jquery.once asset library is   
                    deprecated in Drupal 9.3.0 and will be removed in Drupal    
                    10.0.0. Use the core/once library instead. See              
                    https://www.drupal.org/node/3158256                         
--------------------------------------------------------------------------------

FILE: web/modules/contrib/field_slideshow/field_slideshow.info.yml

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 0    Value of core_version_requirement: ^8 || ^9 is not          
                    compatible with the next major version of Drupal core. See  
                    https://drupal.org/node/3070687.                            
--------------------------------------------------------------------------------
๐Ÿ“Œ Task
Status

Needs work

Version

3.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @c.altosax
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Ashutosh Ahirwal India

    Providing Patch

  • First commit to issue fork.
  • @dineshkumarbollu opened merge request.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dineshkumarbollu

    Hi

    I reviewed the patch it applied cleanly and upgarde status module shows 0 errors, I am created MR for this patch

    Thanks.

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States tjtj

    I got an error after applying ther patch and trying to use the slideshow setting for image display

    Message ArgumentCountError: Too few arguments to function Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter::__construct(), 9 passed in /home/public_html/web/modules/custom/field_slideshow/src/Plugin/Field/FieldFormatter/FieldSlideshow.php on line 98 and exactly 10 expected in Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter->__construct() (line 75 of /home/public_html/web/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php).

  • Status changed to Needs review over 1 year ago
  • I added a commit addressing the PHP error that tjtj mentioned, and also addressed the JS error "$(...).once is not a function."

    After making these changes, I can change the field formatter to "Slideshow" and it displays as expected.

  • After applied the patch issue got fixed and now successfully compatible with D10. Attached before and after screenshot for reference. Hence RTBC+1..

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bcobin

    I have a 9.5.10 site that depends on this module that I'm trying to upgrade to Drupal 10 - I'm assuming that I need to access the forked version at https://git.drupalcode.org/issue/field_slideshow-3341466/-/tree/3341466-... and select the 3341466-drupal-10-compatibility branch.

    (I also assume that I would need to manually change the entry in the "require" section of my composer.json from "drupal/field_slideshow": "^3.0@beta", to "drupal/field_slideshow:^3.x'",)

    But when I try to download, I get "Unsupported GitLab operation." I don't even know if downloading would work; I'm not familiar with Git and have been handling everything via composer install.

    I am totally lost here. Can anyone provide some guidance on what I need to do to get this working in 9.5.10 so that I can successfully upgrade to Drupal 10? Composer install, uploading a file - whatever would work. Any guidance greatly appreciated... thanks in advance!

  • ๐Ÿ‡ณ๐Ÿ‡ฌNigeria chike Nigeria

    @bcobin as the patch here is working (I haven't tried it myself) just patch the module for D10. Use the Composer Drupal Lenient plugin to install the module in D10 and then patch it.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bcobin

    OK - I've managed to install and patch the module, as well as applying the changes from:

    https://git.drupalcode.org/project/field_slideshow/-/merge_requests/3/di...

    I still get the spinning wheel.

    Here's the log error:

    Message Warning: Undefined variable $file_url_generator in Drupal\field_slideshow\Plugin\Field\FieldFormatter\FieldSlideshow->__construct() (line 98 of /[site]/web/modules/contrib/field_slideshow/src/Plugin/Field/FieldFormatter/FieldSlideshow.php)

    Any ideas? Any help greatly appreciated!

  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ฑPoland lamp5 Rzeszow

    Yeah, the reason is that this MR is not working because authors did not test it. I reported 2 issues to fix, to make it works.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bcobin

    I'll offer a bounty to get this fixed if it'll help - it's the one issue that's holding up a D10 site launch.

    Standing by hopefully...

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bcobin

    Got it - I neglected inserting some of the lines from the 575d85d2 commit.

    Thanks for the work done here - a few other fixes and I'm ready to launch!

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium bart lambert

    I'm praying for a quick new beta version with above patch included so I can install it using Composer on D10.

  • ๐Ÿ‡น๐Ÿ‡ทTurkey kburakozdemir ฤฐstanbul

    The patch works for me. so RTBC+1..

  • I am currently using the patch that I provided on our production site. So yes I tested it. :)

    Unfortunately I have limited time to work on Drupal things, so I likely won't be able to contribute further to this issue. @Lamp5 if you see issues with the code that I submitted, please feel free to correct them. I won't be offended.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium bart lambert

    So still no new release available?

  • I am looking at the bg_layout module also for another task, and the author recommended https://www.drupal.org/project/imagefield_slideshow โ†’ which seems similar, may want to look at that project for a field slideshow?

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium bart lambert

    It is indeed similar but what i'm missing is the possibility for a colorbox with bigger pictures that can popup when you click in on the image field.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium bart lambert

    So still no new release available?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bcobin

    I did an upgrade to 10.3.1 and now I get the following error (and page crash) upon viewing a node:

    ArgumentCountError: Too few arguments to function Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter::__construct(), 9 passed in [site]/web/modules/contrib/field_slideshow/src/Plugin/Field/FieldFormatter/FieldSlideshow.php on line 98 and exactly 10 expected in Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter->__construct() (line 76 of [site]/web/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php).

    Does anybody have any ideas here? Thanks in advance!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States je1

    After applying the patch, "composer update --ignore-platform-reqs --dry-run"
    Your requirements could not be resolved to an installable set of packages.
    Problem 1
    drupal/field_slideshow 3.0.0-beta2 requires drupal/core ^8 || ^9 -> satisfiable by drupal/core[8.0.0-beta6, ..., 8.9.x-dev, 9.0.0-alpha1, ..., 9.5.x-dev].

    Any idea how to get composer to work with patch?

Production build 0.71.5 2024