Problem/Motivation
After the release 2.3 the status property value can't be changed from the CasHelper::EVENT_PRE_REGISTER event any more due to the $property_values['status'] = (int) !$this->isAdminApprovalNeeded(); in CasUserManager::register() function.
In certain business cases we would like to maintain the possibility to override the status property on the user before the registration via the pre-register event, as before.
Steps to reproduce
Create an event subscriber for CasHelper::EVENT_PRE_REGISTER event and try to change the status through that.
Proposed resolution
Do not force the status value based on the $this->isAdminApprovalNeeded(); function.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|
Issue fork cas-3450140
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 #2
joevagyok commentedComment #3
joevagyok commentedComment #4
joevagyok commentedComment #7
claudiu.cristeaThank you for reporting. Indeed,
CasHelper::EVENT_PRE_REGISTERevents are pretending that you can alter the user properties but the recent issue just overrides any subscriber changesI've proposed something in the MR but we still need to weight on that and we need tests.
Comment #8
claudiu.cristeaLinking the initial issue
Comment #9
joevagyok commentedI pushed a basic test involving the
CasHelper::EVENT_PRE_REGISTERevent.Comment #10
joevagyok commentedUploading a patch file for composer patching.
Comment #11
claudiu.cristeaTests added
Comment #12
bkosborneThis looks good to me. Feel free to merge and release 2.3.2 claudiu.cristea
Comment #14
claudiu.cristeaThank you