Problem/Motivation

The module is not compatible with Drupal 9

Proposed resolution

Fix Drupal 9 compatibility errors

Remaining tasks

Fix errors

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Drupal 9 compatibility.

Comments

scott_euser created an issue. See original summary.

scott_euser’s picture

Assigned: scott_euser » Unassigned
Status: Active » Needs review
StatusFileSize
new1.01 KB

A couple small fixes:

  1. Add core requirement to info yml so composer can install into Drupal 9
  2. Fix deprecated use of entity.manager service
scott_euser’s picture

Updated tests now as well with Drupal 9 compatibility, setting the default theme for browser tests.

gambry’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me @scott_euser . As `core: 8.x` in info.yml file still allows to install this on version prior 8.7.7 I was wondering if the `$defaultTheme` variable could cause any issue in there, but I believe that change will be just ignored and so all good. RTBC.

jungle’s picture

Drupal\Tests\BrowserTestBase::$defaultTheme is required in drupal:9.0.0 when using an install profile that does not set a default theme. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.
Existing tests which the developer doesn't want to update assertions for
Add:
  protected $defaultTheme = 'classy';
RECOMMENDED Existing tests which the developer wishes to update assertions for to minimize future change
For tests relying on no markup at all or at least no core markup (⚠️This is strongly recommended: avoiding coupling tests to markup whenever possible makes those tests more robust! ⚠️):
  protected $defaultTheme = 'stark';
For tests relying on core markup:

  protected $defaultTheme = 'stable';
New tests
For tests relying on no markup at all or at least no core markup:
  protected $defaultTheme = 'stark';
For tests relying on core markup:

  protected $defaultTheme = 'stable';

Adding protected $defaultTheme = 'classy'; is the quickiest way to fix warnings without update assertions. But it might be good to change it to stark or stable. Or out of this issue's scope?

scott_euser’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.13 KB
new872 bytes

Yes I think $defaultTheme does nothing, just checking in the contribute slack channel.

Updated to use stark, there is no reliance on markup for these tests so tests should pass as is.

scott_euser’s picture

Confirmed by andypost via Slack that defaultTheme will be ignored as you suspected in #4

gambry’s picture

Status: Needs review » Reviewed & tested by the community

Yep, the change makes sense.

jeroent’s picture

Category: Bug report » Task

  • JeroenT committed 41107af on 8.x-1.x authored by scott_euser
    Issue #3108845 by scott_euser, gambry, JeroenT, jungle: Drupal 9...
jeroent’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x-1.x. Thanks!

scott_euser’s picture

Great, thanks!

Status: Fixed » Closed (fixed)

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