Problem/Motivation

drupal-check results on commit hash:
source : [git] https://git.drupal.org/project/juicebox 8649ef0e169c14213a4a98341356a6bab734feb1
source : http://cgit.drupalcode.org/juicebox


 ------ --------------------------------------------------- 
  Line   src/Form/SettingsForm.php                          
 ------ --------------------------------------------------- 
  143    Call to deprecated function drupal_set_message().  
  157    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   src/JuiceboxFormatter.php                          
 ------ --------------------------------------------------- 
  163    Call to deprecated function libraries_detect().    
  364    Call to deprecated method strtolower() of class    
         Drupal\Component\Utility\Unicode.                  
  371    Call to deprecated method strtolower() of class    
         Drupal\Component\Utility\Unicode.                  
  387    Call to deprecated method strtolower() of class    
         Drupal\Component\Utility\Unicode.                  
  440    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ ------------------------------------------------------------ 
  Line   src/Plugin/Field/FieldFormatter/JuiceboxFieldFormatter.php  
 ------ ------------------------------------------------------------ 
  247    Call to deprecated function drupal_set_message().           
  338    Call to deprecated function entity_get_display().           
 ------ ------------------------------------------------------------ 

 ------ --------------------------------------------------- 
  Line   src/Plugin/views/style/JuiceboxDisplayStyle.php    
 ------ --------------------------------------------------- 
  254    Call to deprecated function drupal_set_message().  
  500    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 [ERROR] Found 11 errors                                                    

 

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

mcdwayne created an issue. See original summary.

sergiu stici’s picture

Status: Active » Needs review
StatusFileSize
new115.49 KB

Here is the patch, please review.

Status: Needs review » Needs work

The last submitted patch, 2: drupal_9_deprecated_code-3042821-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

karishmaamin’s picture

Status: Needs work » Needs review
StatusFileSize
new8.13 KB

Please review the code

xem8vfdh’s picture

is this ready to be merged?

xem8vfdh’s picture

Status: Needs review » Needs work

I believe there is also a composer.json change that should be made to add the Drupal 9 support badge to the module's main page, as explained here: https://www.drupal.org/project/auto_entitylabel/issues/3111526

EDIT: or perhaps the change needs to be made to the core_version_requirement field in the module's .info file. Here's an example from another project: https://www.drupal.org/files/issues/2020-03-12/3119389-d9-upgrade-2.patch

EDIT 2: my information about composer.yml and info.yml was incorrect, sorry. Apparently there is some switch the maintainer can flip to trigger the badge and mark the module as D9 compatible, but I don't know where that switch is since I am not a maintainer. Sorry.

xem8vfdh’s picture

Status: Needs work » Needs review
xem8vfdh’s picture

StatusFileSize
new1.58 KB
new9.71 KB

@karishmaamin, when I applied your patch and then ran drupal-check, I detected two remaining issues:

$ ./vendor/bin/drupal-check modules/juicebox
 21/21 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ------------------------------------------------------------------------------------------------------ 
  Line   src/Tests/JuiceboxBaseCase.php                                                                        
 ------ ------------------------------------------------------------------------------------------------------ 
  13     Class Drupal\juicebox\Tests\JuiceboxBaseCase extends deprecated class Drupal\simpletest\WebTestBase:  
         in drupal:8.8.0 and is removed from drupal:9.0.0. Instead,                                            
         use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340.                           
 ------ ------------------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------------------------------------------------ 
  Line   src/Tests/JuiceboxFieldFormatterCase.php                                                                          
 ------ ------------------------------------------------------------------------------------------------------------------ 
  139    Call to deprecated constant NODE_NOT_PUBLISHED: Deprecated in drupal:8.?.? and is removed from drupal:9.0.0. Use  
         \Drupal\node\NodeInterface::NOT_PUBLISHED instead.                                                                
 ------ ------------------------------------------------------------------------------------------------------------------ 

                                                                                                                        
 [ERROR] Found 2 errors

I've attached interdiff_3042821-5.patch to fix this (full patch is updated-3042821-5.patch):

$ ./vendor/bin/drupal-check modules/juicebox
 21/21 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
                                                                                                         
 [OK] No errors
xem8vfdh’s picture

xem8vfdh’s picture

for those that need a replacement that's similar, drupal 9 compliant, and actively maintained, Colorbox seems like a nice option

handkerchief’s picture

Thank you @xeM8VfDh, it's very sad that this awesome project is not really maintained...

neslee canil pinto’s picture

@handkerchief, i have got the access to commit for Juicebox. I will be starting to commit things in prior and make a new release soon.

neslee canil pinto’s picture

Status: Needs review » Needs work
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9940  100  9940    0     0   6437      0  0:00:01  0:00:01 --:--:--  6437
error: patch failed: src/Form/SettingsForm.php:140
error: src/Form/SettingsForm.php: patch does not apply
error: patch failed: src/Plugin/Field/FieldFormatter/JuiceboxFieldFormatter.php:244
error: src/Plugin/Field/FieldFormatter/JuiceboxFieldFormatter.php: patch does not apply
handkerchief’s picture

@Neslee Canil Pinto Thank you so much!
Because Juicebox is really the best gallery option for drupal out there.

neslee canil pinto’s picture

Ya @handkerchief, stay tuned for a release soon👍🏻

suresh prabhu parkala’s picture

Status: Needs work » Needs review
StatusFileSize
new15.52 KB

Re-rolled patch please review!

neslee canil pinto’s picture

Status: Needs review » Needs work
ArgumentCountError: Too few arguments to function Drupal\juicebox\JuiceboxFormatter::__construct(), 6 passed in /Users/neslee/Documents/sites/optimus/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 7 expected in Drupal\juicebox\JuiceboxFormatter->__construct() (line 98 of /Users/neslee/Documents/sites/optimus/web/modules/custom/juicebox/src/JuiceboxFormatter.php)
suresh prabhu parkala’s picture

Assigned: Unassigned » suresh prabhu parkala
suresh prabhu parkala’s picture

Status: Needs work » Needs review
StatusFileSize
new17.09 KB

Re-rolled patch please review. Included remaining depreacted code and 'core_version_requirement' key in .info file.

Status: Needs review » Needs work

The last submitted patch, 19: 3042821-19.patch, failed testing. View results

neslee canil pinto’s picture

Issue tags: +Needs reroll

Needs reroll

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17504  100 17504    0     0  14947      0  0:00:01  0:00:01 --:--:-- 14935
error: patch failed: src/JuiceboxFormatter.php:84
error: src/JuiceboxFormatter.php: patch does not apply
error: patch failed: src/Plugin/Field/FieldFormatter/JuiceboxFieldFormatter.php:66
error: src/Plugin/Field/FieldFormatter/JuiceboxFieldFormatter.php: patch does not apply
error: tests/src/FunctionalJavascript/JuiceboxCaseTestBase.php: No such file or directory
error: tests/src/FunctionalJavascript/JuiceboxFieldFormatterCaseTest.php: No such file or directory
neslee canil pinto’s picture

StatusFileSize
new508 bytes
suresh prabhu parkala’s picture

Status: Needs work » Needs review
StatusFileSize
new13.77 KB

Re-rolled patch please review.

Status: Needs review » Needs work

The last submitted patch, 23: 3042821-23.patch, failed testing. View results

suresh prabhu parkala’s picture

Status: Needs work » Needs review
StatusFileSize
new13.75 KB

Re-rolled patch please review.

Status: Needs review » Needs work

The last submitted patch, 25: 3042821-25.patch, failed testing. View results

fkelly12054@gmail.com’s picture

A couple of us have a version that started with 8.x-2.x-dev on a separate Github repository. We have invited Neslee to copy it over to a branch here. Then we can run a new Drupal 9 Deprecated Code Report and see if there are any remaining issues. We have tested the code on a couple of D9 test sites and seem to have ironed the issues ... but you never know. The release will also remove the need to use the contrib libraries module and allow use of media items in Juicebox galleries. We've done something like 139 commits since 8.x-2.x-dev.

neslee canil pinto’s picture

Great job @fkelly and @DK. I will be pushing a new branch for drupal 9 now👍🏻

neslee canil pinto’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev

New release has been made, please test this in 8.x-3.x branch and confirm.

neslee canil pinto’s picture

Status: Needs work » Needs review

We need more people to test the new release for drupal 9 - https://www.drupal.org/project/juicebox/releases/8.x-3.0-alpha1

neslee canil pinto’s picture

Assigned: suresh prabhu parkala » Unassigned
fkelly12054@gmail.com’s picture

Note that, in addition to working with Drupal 9, this release also works with the 8.9 series of Drupal Core releases.

There are users who are using 8.9x who may wish to remove the contrib module libraries dependency but also have other contrib modules which are not Drupal 9 ready. They can use this release (noting that it's at alpha level now (December 2020)) and be positioned to upgrade to Drupal 9 when their other modules are Drupal 9 ready.

There are quite a few coding fixes in the 8.x-3 release. If you don't need the contrib libraries module to support other contrib modules which have external JS libraries for instance, you can disable/remove the libraries module. Media items should now work in Juicebox galleries.

neslee canil pinto’s picture

Status: Needs review » Fixed

Tagged new release https://www.drupal.org/project/juicebox/releases/8.x-3.0-alpha2 which solves Drupal 9 Deprecated Code.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ikeigenwijs’s picture

did a composer install
this poped up again

drupal 9.3
alfa version and dev

fkelly12054@gmail.com’s picture

What was the syntax of your composer install?

It needs to be:

composer require "drupal/juicebox": "^3.0.0-alpha2"

or
composer require 'drupal/juicebox:^3.0@alpha'

depending on how your command line tool handles quotes. Let us know more precisely what your composer json code is and how you re applying it.

Given the crazy pace at which Drupal moves forward, and deprecates things, I would not be at all surprised if we need to go back through the code and update a number of functions. I'm trying to do that now in a copy of the test directory code I am running locally in PHPStorm using the PHPunit tests. It's not easy. I suspect the overall Juicebox code will need some significant work going thru 9.3 to 9.4 and then into Drupal 10.

But right now juicebox 3.0 alpha works with Drupal 9.3x.