Prepare Drupal 10 compatibility (planned for August 2022).

Running drupal-check reports:

FILE: src/Element/LayoutBuilder.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 21   Class Drupal\layout_builder_st\Element\LayoutBuilder extends
                    @internal class Drupal\layout_builder\Element\LayoutBuilder.
--------------------------------------------------------------------------------

FILE: src/Form/BlockContentInlineBlockTranslateF
orm.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 20   Class                                                       
                    Drupal\layout_builder_st\Form\BlockContentInlineBlockTransla
                    teForm extends @internal class                              
                    Drupal\block_content\BlockContentForm.                      
--------------------------------------------------------------------------------

FILE: src/Form/OverridesEntityForm.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 14   Class Drupal\layout_builder_st\Form\OverridesEntityForm     
                    extends @internal class                                     
                    Drupal\layout_builder\Form\OverridesEntityForm.             
--------------------------------------------------------------------------------

FILE: src/InlineBlockEntityOperations.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 12   Class Drupal\layout_builder_st\InlineBlockEntityOperations  
                    extends @internal class                                     
                    Drupal\layout_builder\InlineBlockEntityOperations.          
--------------------------------------------------------------------------------

FILE: src/Plugin/Block/InlineBlock.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 13   Class Drupal\layout_builder_st\Plugin\Block\InlineBlock     
                    extends @internal class                                     
                    Drupal\layout_builder\Plugin\Block\InlineBlock.             
--------------------------------------------------------------------------------

FILE: src/Plugin/Field/FieldWidget/LayoutBuilder
Widget.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 14   Class                                                       
                    Drupal\layout_builder_st\Plugin\Field\FieldWidget\LayoutBuil
                    derWidget extends @internal class                           
                    Drupal\layout_builder\Plugin\Field\FieldWidget\LayoutBuilder
                    Widget.                                                     
--------------------------------------------------------------------------------

FILE: src/Plugin/SectionStorage/OverridesSection
Storage.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 11   Class                                                       
                    Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSect
                    ionStorage extends @internal class                          
                    Drupal\layout_builder\Plugin\SectionStorage\OverridesSection
                    Storage.                                                    
--------------------------------------------------------------------------------

FILE: web/modules/contrib/layout_builder_st/src/ResourceTypeRepository.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 9    Class Drupal\layout_builder_st\ResourceTypeRepository       
                    extends @internal class                                     
                    Drupal\jsonapi\ResourceType\ResourceTypeRepository.         
--------------------------------------------------------------------------------

FILE: tests/src/Functional/LayoutBuilderTranslat
ionTest.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 272  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 273  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 295  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------

FILE: tests/src/FunctionalJavascript/InlineBlock
TranslationTest.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 64   Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 69   Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 90   Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------

FILE: tests/src/FunctionalJavascript/ModeratedTr
anslationTest.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 109  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 115  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 120  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------

FILE: tests/src/FunctionalJavascript/Translation
Test.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Check manually 173  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 179  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------
Check manually 184  Call to deprecated method drupalPostForm() of class         
                    Drupal\Tests\BrowserTestBase. Deprecated in drupal:9.1.0 and
                    is removed from drupal:10.0.0. Use $this->submitForm()      
                    instead.                                                    
--------------------------------------------------------------------------------

FILE: layout_builder_st.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.                            
--------------------------------------------------------------------------------

Thank's

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:

Comments

S3b0uN3t created an issue. See original summary.

victoria-marina’s picture

Assigned: Unassigned » victoria-marina

I'll work on this.

victoria-marina’s picture

Assigned: victoria-marina » Unassigned
Status: Active » Needs review
StatusFileSize
new5.33 KB

Hi! I don't know exactly how to solve the @internal warnings, but I made a patch to solve the other ones. Kindly review it.

tmaiochi’s picture

Assigned: Unassigned » tmaiochi

I'll review this!

s3b0un3t’s picture

Thank's you @victoria-marina and @tmaiochi for your responsiveness.

avpaderno’s picture

Title: Drupal 10 compatibility » Make the code compatible with Drupal 10
Version: 8.x-1.0-alpha2 » 8.x-1.x-dev
Status: Needs review » Needs work
-core: 8.x
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^9 || ^10

Since the patch changes the code to use a method that is available starting from Drupal 9.1.x, the core requirement should reflect that.

 dependencies:
   - drupal:layout_builder
-  - drupal:system (>=8.7)
+  - drupal:system (>=9.0)

The dependency on a particular version of the System module isn't more necessary, starting from Drupal 8.8.x. core_version_requirement is sufficient.

tmaiochi’s picture

Assigned: tmaiochi » Unassigned
Status: Needs work » Needs review
StatusFileSize
new5.39 KB
new10.75 KB

I made some changes on #3, and I tried to fix @internal warnings, but I couldn't.
And I did the changes asked in #6

avpaderno’s picture

As for the warnings for the @internal methods/classes, I would check if those methods/classes have been marked as internal in Drupal 10. If they are internal since Drupal 8 or Drupal 9, it's not a Drupal 10 compatibility issue. That still needs to be fixed, but it's not on scope for this issue.

avpaderno’s picture

Status: Needs review » Needs work
rassoni’s picture

Assigned: Unassigned » rassoni
rassoni’s picture

Assigned: rassoni » Unassigned
lucasbaralm’s picture

Assigned: Unassigned » lucasbaralm

I will work on it.

lucasbaralm’s picture

Assigned: lucasbaralm » Unassigned
Status: Needs work » Needs review
StatusFileSize
new13.29 KB
new2.46 KB

First, I checked all the internal warnings mentioned in the issue summary against drupal docs, concluding that they were all internal in before Drupal 10.

FILE: src/Element/LayoutBuilder.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Internal b. D10 21   Class Drupal\layout_builder_st\Element\LayoutBuilder extends
                     @internal class Drupal\layout_builder\Element\LayoutBuilder.
--------------------------------------------------------------------------------

FILE: src/Form/BlockContentInlineBlockTranslateF
orm.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Internal b. D10 20   Class                                                       
                     Drupal\layout_builder_st\Form\BlockContentInlineBlockTransla
                     teForm extends @internal class                              
                     Drupal\block_content\BlockContentForm.                      
--------------------------------------------------------------------------------

FILE: src/Form/OverridesEntityForm.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Internal b. D10 14   Class Drupal\layout_builder_st\Form\OverridesEntityForm     
                    extends @internal class                                     
                    Drupal\layout_builder\Form\OverridesEntityForm.             
--------------------------------------------------------------------------------

FILE: src/InlineBlockEntityOperations.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Internal b. D10 12   Class Drupal\layout_builder_st\InlineBlockEntityOperations  
                    extends @internal class                                     
                    Drupal\layout_builder\InlineBlockEntityOperations.          
--------------------------------------------------------------------------------

FILE: src/Plugin/Block/InlineBlock.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Internal b. D10 13   Class Drupal\layout_builder_st\Plugin\Block\InlineBlock     
                    extends @internal class                                     
                    Drupal\layout_builder\Plugin\Block\InlineBlock.             
--------------------------------------------------------------------------------

FILE: src/Plugin/Field/FieldWidget/LayoutBuilder
Widget.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Internal b. D10 14   Class                                                       
                    Drupal\layout_builder_st\Plugin\Field\FieldWidget\LayoutBuil
                    derWidget extends @internal class                           
                    Drupal\layout_builder\Plugin\Field\FieldWidget\LayoutBuilder
                    Widget.                                                     
--------------------------------------------------------------------------------

FILE: src/Plugin/SectionStorage/OverridesSection
Storage.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Internal b. D10 11   Class                                                       
                    Drupal\layout_builder_st\Plugin\SectionStorage\OverridesSect
                    ionStorage extends @internal class                          
                    Drupal\layout_builder\Plugin\SectionStorage\OverridesSection
                    Storage.                                                    
--------------------------------------------------------------------------------

FILE: web/modules/contrib/layout_builder_st/src/ResourceTypeRepository.php

STATUS         LINE                           MESSAGE                           
--------------------------------------------------------------------------------
Internal b. D10 9    Class Drupal\layout_builder_st\ResourceTypeRepository       
                    extends @internal class                                     
                    Drupal\jsonapi\ResourceType\ResourceTypeRepository.         
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

Then running the tests even though they are partially broken they showed the following warning about deprecations:

Remaining self deprecation notices (22)

  11x: The event_dispatcher service should be passed to LayoutBuilder::__construct() instead of the layout_builder.tempstore_repository service since 9.1.0. This will be required in Drupal 10.0.0. See https://www.drupal.org/node/3152690
    1x in LayoutBuilderEntityViewDisplayTest::testGetIndividual from Drupal\Tests\layout_builder_st\Functional\Jsonapi
    1x in LayoutBuilderEntityViewDisplayTest::testCollection from Drupal\Tests\layout_builder_st\Functional\Jsonapi
    1x in LayoutBuilderTranslationTest::testLayoutPerTranslation from Drupal\Tests\layout_builder_st\Functional
    1x in LayoutBuilderTranslationTest::testLayoutTranslationNoOverride from Drupal\Tests\layout_builder_st\Functional
    1x in LayoutBuilderTranslationTest::testTranslatableLayoutField from Drupal\Tests\layout_builder_st\Functional
    1x in LayoutBuilderEntityViewDisplayJsonAnonTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest
    1x in LayoutBuilderEntityViewDisplayJsonBasicAuthTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest
    1x in LayoutBuilderEntityViewDisplayJsonCookieTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest
    1x in LayoutBuilderEntityViewDisplayXmlAnonTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest
    1x in LayoutBuilderEntityViewDisplayXmlBasicAuthTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest
    1x in LayoutBuilderEntityViewDisplayXmlCookieTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest

  11x: Calling LayoutBuilder::__construct() with the $messenger argument is deprecated in drupal:9.1.0 and will be removed in drupal:10.0.0. See https://www.drupal.org/node/3152690
    1x in LayoutBuilderEntityViewDisplayTest::testGetIndividual from Drupal\Tests\layout_builder_st\Functional\Jsonapi
    1x in LayoutBuilderEntityViewDisplayTest::testCollection from Drupal\Tests\layout_builder_st\Functional\Jsonapi
    1x in LayoutBuilderTranslationTest::testLayoutPerTranslation from Drupal\Tests\layout_builder_st\Functional
    1x in LayoutBuilderTranslationTest::testLayoutTranslationNoOverride from Drupal\Tests\layout_builder_st\Functional
    1x in LayoutBuilderTranslationTest::testTranslatableLayoutField from Drupal\Tests\layout_builder_st\Functional
    1x in LayoutBuilderEntityViewDisplayJsonAnonTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest
    1x in LayoutBuilderEntityViewDisplayJsonBasicAuthTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest
    1x in LayoutBuilderEntityViewDisplayJsonCookieTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest
    1x in LayoutBuilderEntityViewDisplayXmlAnonTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest
    1x in LayoutBuilderEntityViewDisplayXmlBasicAuthTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest
    1x in LayoutBuilderEntityViewDisplayXmlCookieTest::testGet from Drupal\Tests\layout_builder_st\Functional\Rest

So, fixing these warnings as mentioned in https://www.drupal.org/node/3152690, I created the following patch

sophiavs’s picture

Assigned: Unassigned » sophiavs

I'll be reviewing the last patch :)

sophiavs’s picture

Assigned: sophiavs » Unassigned
Status: Needs review » Needs work

Everything looks fine on the patch, just as @lucasbaralm said, the most erros are on the tests calling undefined methods, in special "Drupal\Component\Plugin\PluginInspectionInterface::getConfiguration", so it still needs works to change that method.

gquisini’s picture

Assigned: Unassigned » gquisini
gquisini’s picture

Assigned: gquisini » Unassigned

I was working on this issue before I assign myself to it and thought I was solving it, but in reality I made a lot of changes to the tests and other stuffs that are not related to this issue. My bad.

phenaproxima’s picture

Hiding patches in favor of switching to a merge request workflow.

phenaproxima’s picture

Status: Needs work » Reviewed & tested by the community

Although it seems that D10 testing is somehow broken upstream (it's being looked into), it passed on Drupal 10 beta2, which is good enough for me. I've gotten sign-off in Slack from @tedbow and @tim.plunkett regarding the constructor change that breaks backwards compatibility -- I don't personally think it's a problem, for a few reasons:

  1. This module is alpha stability, which means API breaks are allowed.
  2. The constructor in question is part of a final class, so there are no subclasses that this change could break.
  3. The class is an element, which would never, under normal circumstances, be instantiated directly except by the plugin manager.
  4. The class is also a plugin implementation, which are considered internal anyway and not part of the API.
phenaproxima’s picture

Updating credit.

  • phenaproxima committed 6ee3bf1 on 8.x-1.x
    Issue #3269892 by phenaproxima, tmaiochi, lucasbaralm, victoria-marina,...
phenaproxima’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, everyone, for your work on this. Merged into 8.x-2.x! New release forthcoming.

Status: Fixed » Closed (fixed)

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