When i add a menu link (example: /user/register/company) gives me this error in every page that the menu is loaded:

Deprecated function: Non-static method Drupal\user\Access\RegisterAccessCheck::access() should not be called statically in Drupal\multiple_registration\Controller\MultipleRegistrationController->access() (line 61 of modules/contrib/multiple_registration/src/Controller/MultipleRegistrationController.php).

If the current user is not UID 1 user.

Comments

joao.ramos created an issue. See original summary.

joao.ramos.costa’s picture

Priority: Major » Normal

multiple_registration.routing.yml

multiple_registration.role_registration_page:
path: 'user/register/{rid}'
defaults:
_entity_form: 'user.register'
_title_callback: '\Drupal\multiple_registration\Controller\MultipleRegistrationController::getRegisterPageTitle'
requirements:
_custom_access: '\Drupal\multiple_registration\Controller\MultipleRegistrationController::access'

I changed the requeriments:
_custom_acess : '...'
for _permission: 'access content'

(the permission that i want in fact, and it worked well )

I guess the problem is in in the custom requirement;
I will try to solve it and i'll try to patch it.

IreneV’s picture

Thank you for reporting this bug!

This issue already fixed in latest dev version. Will be added into next release.

ysamoylenko’s picture

Status: Active » Fixed

Hi joao.ramos.

The problem was following to static call to the public function /core/modules/user/src/Access/RegisterAccessCheck.php:23.
Currently, I've fixed the problem and pushed the changes to the dev release.
Please download the latest version of the module and check the problem again.
Thank you for the report.

joao.ramos.costa’s picture

Thank you for your help!

Status: Fixed » Closed (fixed)

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