Closed (won't fix)
Project:
User Restrictions
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
4 Nov 2025 at 09:43 UTC
Updated:
26 Nov 2025 at 20:48 UTC
Jump to comment: Most recent
Currently, the UserRestrictionsFormBase class implements the create() method, but that is not necessary for child classes to use AutoWireTrait.
UserRestrictionsFormBase::create()$typeManager property nullable; property promotion should no longer be usedUserRestrictionsFormBase::setTypeManager() function which initializes the new propertyUserRestrictionsFormBase::getTypeManager() function which triggers an error when $typeManager has not been set, and sets $typeManager; the trigger error needs to explain that constructors for child classes needs to call UserRestrictionsFormBase::setTypeManager()UserRestrictionsFormBase method that directly uses $typeManager to call UserRestrictionsFormBase::getTypeManager()UserRestrictionsFormBaseStart 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 #2
avpadernoComment #3
avpadernoComment #4
santanu mondal commentedWorking On It.
Comment #5
santanu mondal commentedComment #7
avpadernoComment #8
santanu mondal commentedComment #9
avpadernoThe errors/warnings reported by GitLab need to be fixed.
Comment #10
santanu mondal commentedHi @avpaderno I have solve the Gitlab warning please check.
Comment #11
santanu mondal commentedComment #12
avpadernoI will review the merge request using the plain diff.
Since the module requires PHP 8.3, typed constants are allowed. The existing code is correct.
The file to change is src/Form/UserRestrictionsAddForm.php, which exists, not src/Form/UserRestrictionAddForm.php.
The file to change is src/Form/UserRestrictionsFormBase.php, which exists, not src/Form/UserRestrictionFormBase.php.
Between those lines there must be an empty line.
It is the user restriction type manager. A manager is a service; there is no need to say that.
UserRestrictionsFormBase::getTypeManager()does not get any parameter; that message is supposed to say that child classes needs to callUserRestrictionsFormBase::setTypeManager()in their constructors.It is user_restrictions:2.1.1, not user_restrictions:2.0.0.
Also, for backward-compatibility reasons, that code needs to initialize
$this->typeManager, when it has not been already initialized.I would suggest to start fresh with a new issue fork created from the 2.1.x branch. (I created 3555932-allow-child-classes-to-use-AutowireTrait for this reason. It is updated with the current changes done in the 2.1.x branch.)
Comment #14
avpadernoComment #16
santanu mondal commentedComment #17
avpadernoComment #19
avpadernoComment #21
avpadernoI reverted the change, since it was a wrong change.