Problem/Motivation

We need to add Drupal 11 support while preserving backwards compatibility for Drupal 9 and 10.

Deprecations reported by the Upgrade Status module:

File name Line Error
modules/contrib/content_moderation_notifications/src/Form/ContentModerationNotificationsFormBase.php 156 Call to deprecated function user_role_names(). Deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use Drupal\user\Entity\Role::loadMultiple() and, if necessary, an inline implementation instead.
modules/contrib/content_moderation_notifications/src/Form/ContentModerationNotificationsFormBase.php 238 Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.
modules/contrib/content_moderation_notifications/src/NotificationInformation.php 112 Relying on entity queries to check access by default is deprecated in drupal:9.2.0 and an error will be thrown from drupal:10.0.0. Call \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with TRUE or FALSE to specify whether access should be checked.
modules/contrib/content_moderation_notifications/content_moderation_notifications.info.yml 5 Value of core_version_requirement: ^9 || ^10 is not compatible with the next major version of Drupal core. See https://drupal.org/node/3070687.
{ can ignore } modules/contrib/content_moderation_notifications/src/Notification.php 130 Call to deprecated method renderPlain() of class Drupal\Core\Render\Renderer. Deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use Drupal\Core\Render\RendererInterface::renderInIsolation() instead.
{ can ignore } modules/contrib/content_moderation_notifications/src/Notification.php 142 Call to deprecated method renderPlain() of class Drupal\Core\Render\Renderer. Deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use Drupal\Core\Render\RendererInterface::renderInIsolation() instead.
{ can ignore } modules/contrib/content_moderation_notifications/src/Notification.php 188 Call to deprecated method renderPlain() of class Drupal\Core\Render\Renderer. Deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use Drupal\Core\Render\RendererInterface::renderInIsolation() instead.
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

aziza_a created an issue. See original summary.

aziza_a’s picture

Issue summary: View changes

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

sarwan_verma’s picture

Status: Active » Needs review

Hi,

I have resolved the Drupal 11 compatibility issues and created MR!22.
Please review and verify it.

Thanks!

luke.leber’s picture

Status: Needs review » Needs work

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

mark_fullmer’s picture

Issue summary: View changes
mark_fullmer’s picture

Status: Needs work » Needs review

The latest round of changes to the existing MR opts for using Drupal's DeprecationHelper so that versions before Drupal 10.3 still use renderPlain, per https://www.drupal.org/node/3407994 .

Also, the replacement for user_role_names() was wrong, so I updated that.

Finally, I refactored the test logic to work with Drupal 11.

Setting to "Needs review."

mark_fullmer’s picture

Status: Needs review » Reviewed & tested by the community

Marking as RTBC, based on the comment above from the MR.

adel-by’s picture

Tested and works as expected.

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

jhedstrom’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all! I'll cut a new release shortly.

Status: Fixed » Closed (fixed)

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