Problem/Motivation

Declaration of Drupal\field_group\Routing\RouteSubscriber::getSubscribedEvents() must be compatible with Drupal\Core\Routing\RouteSubscriberBase::getSubscribedEvents(): array

Steps to reproduce

Use the module with Drupal 10 / PHP 8.1.

Proposed resolution

Update function declaration for \Drupal\field_group\Routing\RouteSubscriber::getSubscribedEvents().

Remaining tasks

  • Create MR
  • Review MR
  • Merge MR

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ricovandevin created an issue. See original summary.

ricovandevin’s picture

Issue summary: View changes
Status: Active » Needs review
andreic’s picture

Just tested with the latest Drupal 10 and it works as expected.

JurriaanRoelofs’s picture

Status: Needs review » Reviewed & tested by the community

Just tested with D10 alpha4 and indeed it seems this is the only deprecation fix needed.

Berdir made their first commit to this issue’s fork.

Berdir’s picture

Status: Reviewed & tested by the community » Needs review

I'm not sure how you tested that considering that the module is not declared as D10 compatible and can't be installed there?

The tests also needed a bunch of changes and there is .once() which needed to be updated as well. Needs manual testing for that.

levmyshkin’s picture

Run drupal_check on field_group module and got:

Line   field_group.module  
------ ---------------------------------------------------------------------- 

 844    Call to deprecated method getImplementations() of class               
         Drupal\Core\Extension\ModuleHandlerInterface:                         
         in drupal:9.4.0 and is removed from drupal:10.0.0. Instead you        
           should use ModuleHandlerInterface::invokeAllWith() for hook         
         invocations                                                           
           or you should use ModuleHandlerInterface::hasImplementations() to   
           determine if hooks implementations exist.      
           
           
 ------ --------------------------------------------------------------------- 
  Line   src/FormatterHelper.php                                              
 ------ --------------------------------------------------------------------- 
  102    Call to deprecated method getImplementations() of class              
         Drupal\Core\Extension\ModuleHandlerInterface:                        
         in drupal:9.4.0 and is removed from drupal:10.0.0. Instead you       
           should use ModuleHandlerInterface::invokeAllWith() for hook        
         invocations                                                          
           or you should use ModuleHandlerInterface::hasImplementations() to  
           determine if hooks implementations exist.                          
 ------ --------------------------------------------------------------------- 

It's related to this new method in Drupal 10:
https://www.drupal.org/node/3000490

Added patch for that.

levmyshkin’s picture

I installed Field Group locally and created field group on Manage Display and Form Display pages. It worked as expected. Field Group has a lot of features, do we have list of cases for testing? I could go through them.
I use Field Group module for my contrib modules:
https://www.drupal.org/project/ebt_core
and blocked by Field Group module to add Drupal 10 compatibility to my modules.

Berdir’s picture

Thanks, I was too lazy to add the conditional check, added that to the MR.

I also fixed the JS tests.

Since I changed the JS for all the different types that field group has, testing them all and making sure that there are no JS errors would be good.

andrea.cividini’s picture

+1 for the MR, tested and working on 10.0.0-alpha6 / PHP 8.1

Narine_Tsaturyan’s picture

+1 Tested on 10.0.0-alpha6 everything works as expected.

nkoporec made their first commit to this issue’s fork.

nkoporec’s picture

I have updated the MR and also fix some deprecated code in tests, I have also removed the composer.json core requirement, as it is not necessary since composer uses information from info.yml to generate the requirements for drupal core.

Berdir’s picture

Status: Needs review » Needs work

It is required to be able to run tests against D10, the composer.json info is only updated after it has been committed. The test configuration needs to be updated to test MR's at all, but we could upload a patch for that.

I added some comments on your changes.

nkoporec’s picture

Status: Needs work » Needs review

@Berdir, thanks for the review, I have fixed the issue you found, so this needs another review.

Berdir’s picture

Status: Needs review » Needs work

another review.

mglaman’s picture

whoops, berdir looks like I double reviewed on the MR.

nkoporec’s picture

Status: Needs work » Needs review

I have bump the core requirement to 9.2 and drop the 8 , due to the once() change.

swentel’s picture

Committed first part #3310222: Branch tests fail on description_display notice and in MigrateUiFieldGroupTest to get branch tests working again (#description_display minimal fix)

swentel’s picture

And #3310222: Branch tests fail on description_display notice and in MigrateUiFieldGroupTest is in. Will commit a couple of patches on the 8.x-3.x branch first for a release (bug fixes only). After that I'll use the work here to start adding D10 support.

(I'm not good in doing merges, so I'll take the raw patch from the commits in that branch and do some tests)

Berdir’s picture

Do you need a rebase of this or are you working on it?

swentel’s picture

Rebase would be great of course, but no worries if that doesn't work out.

Berdir’s picture

Done, also fixed a previous incorrect merge that reverted #3154304: Remove jQuery UI Accordion dependency and warning. That said, as just commented there, that change was incomplete as it didn't update the corresponding field_group_library_info_alter(). I did a bit of cleanup there now as well.

Berdir’s picture

swentel’s picture

Ok great, I've committed #3059614: Undefined property: stdClass::$region in field_group_form_process(), and I want to commit #3218305: formProcess function should expect value, not reference as well. (or at least do something hehe)

Could you check that last one whether the (small) change makes sense since there seems to be a relation with Paragraphs (both in #3138364: #pre_render deprecation using field_group (paragraphs) and #3147495: Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface (field group, but I think I close that one).

Again, no rush. After those, I'm triggering a release and start working on getting this in.

swentel’s picture

Patch applies fine, and basic manual tests are working, so will commit soon so I can start setting up test branches and start committing other RTBC issues and more other things that have been sitting in the queue.

Opened #3310295: Check testHorizontalTabsLabels (add stable test dependencies?) to see if I can add stable as a test dependency for HorizontalTabsLabelsTest (did that with DS as well, and seems to work fine for both D9/D10 tests)

  • swentel committed a75deb2 on 8.x-3.x
    Issue #3278537 by Berdir, nkoporec, ricovandevin, levmyshkin: D10...
swentel’s picture

jquery_ui_accordion doesn't have a D10 commit yet, waiting for #3288097: Automated Drupal 10 compatibility fixes for jQuery UI Accordion to get in.

Will remove the require-dev line - should be the only line to get the branch tests working setup for D10

  • swentel committed 7cc980d on 8.x-3.x
    Issue #3278537: remove jquery_ui_accordion from require-dev
    

  • swentel committed 70ef5df on 8.x-3.x
    Issue #3278537: make MigrateUiFieldGroupTest compatible
    

  • swentel committed e3ff8f6 on 8.x-3.x
    Issue #3278537: make all test classes compatible
    
swentel’s picture

Status: Needs review » Fixed

Branch tests are failing on classy not existing, so working further in #3310295: Check testHorizontalTabsLabels (add stable test dependencies?)

Marking this one fixed, thanks for all the work!

swentel’s picture

Status: Fixed » Closed (fixed)
Berdir’s picture

Awesome, thanks. This was the last blocker to run paragraphs D10 tests on DrupalCI (we have a lot of require-dev dependencies).

And yes, I kinda forgot about the classy thing, in several of my projects as well.