I'm not a coder myself, but maybe somebody with some extra spare time can have a look at the following upgrade status output to make the module work with drupal 11.
Problem/Motivation
The module is not ready for drupal 11. I ran upgrade_status on the module with the following results:
================================================================================
Flag, 8.x-4.0-beta4
Scanned on zo 05/12/2024 - 14:22
FILE:
\flag\src\Controller\FlagListBuilder.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix later 53 Call to deprecated function user_roles(). 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.
--------------------------------------------------------------------------------
FILE: \flag\src\Form\FlagFormBase.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix later 350 Call to deprecated function user_roles(). 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.
--------------------------------------------------------------------------------
FILE:
\flag\src\Plugin\views\relationship\FlagViewsRelationship.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Fix later 148 Call to deprecated function user_roles(). 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.
--------------------------------------------------------------------------------
FILE:
\flag\tests\src\Functional\AdminUITest.php
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Check manually 188 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.
--------------------------------------------------------------------------------
Check manually 204 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.
--------------------------------------------------------------------------------
FILE: modules/contrib/flag/flag.info.yml
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Check manually 3 Value of core_version_requirement: ^9.1 || ^10 is not
compatible with the next major version of Drupal core. See
https://drupal.org/node/3070687.
--------------------------------------------------------------------------------
FILE: modules/contrib/flag/modules/flag_bookmark/flag_bookmark.info.yml
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Check manually 3 Value of core_version_requirement: ^9.1 || ^10 is not
compatible with the next major version of Drupal core. See
https://drupal.org/node/3070687.
--------------------------------------------------------------------------------
FILE: modules/contrib/flag/modules/flag_count/flag_count.info.yml
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Check manually 3 Value of core_version_requirement: ^9.1 || ^10 is not
compatible with the next major version of Drupal core. See
https://drupal.org/node/3070687.
--------------------------------------------------------------------------------
FILE: modules/contrib/flag/modules/flag_follower/flag_follower.info.yml
STATUS LINE MESSAGE
--------------------------------------------------------------------------------
Check manually 3 Value of core_version_requirement: ^9.1 || ^10 is not
compatible with the next major version of Drupal core. See
https://drupal.org/node/3070687.
--------------------------------------------------------------------------------
Proposed resolution
Fix these small problems so that the module can be used on drupal 11 installs.
Issue fork flag-3446713
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
Comment #4
aaron.ferris commentedHad an initial stab at this, where the user_roles function has been replaced it seems to be working the same way, needs more testing.
Any BC concerns here?
Comment #6
prabuela commentedComment #7
prabuela commentedComment #8
prabuela commentedHi @aaron.ferris
I have switched to your branch and executed upgrade status scan once again. I found some issue in the scan. Attaching below. Please correct me if I am wrong.
CONTRIBUTED PROJECTS
--------------------------------------------------------------------------------
Flag
Scanned on Tue, 05/14/2024 - 08:41.
3 warnings found.
web/modules/contrib/flag/src/Plugin/views/relationship/FlagViewsRelationship.php:
+-----------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| status | line | message |
+-----------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Fix
later | 148 | Call to deprecated function user_roles(). 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.
|
+-----------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
web/modules/contrib/flag/tests/src/Functional/AdminUITest.php:
+----------------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| status | line | message |
+----------------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Check
manually | 188 | 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.
|
| Check
manually | 204 | 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.
|
+----------------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Comment #9
prabuela commentedComment #10
aaron.ferris commentedHello @PrabuEla
Thanks, yes indeed, I missed FlagViewsRelationship.php. Ill check the other complaints.
Comment #11
berdirLeft some comments. This should opt in to NEXT_MAJOR testing so we can verify the tests actually work on D11.
Comment #15
samitk commentedComment #16
solideogloria commentedComment #17
solideogloria commentedComment #20
berdirAll tests are passing except #3461212: FlagFollowerUITest failing since new access policy was committed to core and that's failing already on HEAD and fails on all branches.
Not sure how this ended up with so many different branches and merge requests, but *shrug*.
Merged.