Problem/Motivation

When mentioning a user in a WYSIWYG field, on a site running on PHP 8.1, I receive the following notice:

Deprecated function: current(): Calling current() on an object is deprecated in Drupal\ckeditor_mentions\MentionsType\MentionsTypeBase->defaultConfiguration()

Steps to reproduce

Install on a Drupal 9 site on PHP 8.1 and insert a mention.

Proposed resolution

I question even using `current()` to begin with. The Drupal render service works perfectly fine when rendering arrays.

Remaining tasks

Review PR.

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:

Comments

pianomansam created an issue. See original summary.

pianomansam’s picture

Issue summary: View changes
Status: Active » Needs review

I've created an issue fork and PR that removes the use of current() from defaultConfiguration() in MentionsTypeBase.

idebr’s picture

Version: 8.x-2.0-alpha2 » 8.x-2.x-dev
Status: Needs review » Reviewed & tested by the community

Patch works as expected, thanks!

mwebaze’s picture

@idebr where can I find the patch you tested?

pianomansam’s picture

@mwebaze the patch is linked as the "plain diff" in the issue fork section of this issue, otherwise you can access it here:

https://git.drupalcode.org/project/ckeditor_mentions/-/merge_requests/8....

nina_jeq’s picture

Hi there
Here is the patch.

andrei.vesterli’s picture

Hi

I've added a test for php 8.1. Let's hope that it will succeed.

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

  • dinazaur committed 8987c67d on 8.x-2.x authored by pianomansam
    Issue #3279121: On PHP 8.1, Calling current() on an object is deprecated
    
dinazaur’s picture

Status: Reviewed & tested by the community » Fixed
andrei.vesterli’s picture

Hi @dinazaur

Add a credit for @nina_jeq, please.

dinazaur’s picture

Status: Fixed » Closed (fixed)

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