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

CommentFileSizeAuthor
#10 3450140-10.patch3.64 KBjoevagyok

Issue fork cas-3450140

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

joevagyok created an issue. See original summary.

joevagyok’s picture

Issue summary: View changes
joevagyok’s picture

Priority: Normal » Major
joevagyok’s picture

Issue summary: View changes

claudiu.cristea made their first commit to this issue’s fork.

claudiu.cristea’s picture

Status: Active » Needs work
Issue tags: +Needs tests

Thank you for reporting. Indeed, CasHelper::EVENT_PRE_REGISTER events are pretending that you can alter the user properties but the recent issue just overrides any subscriber changes

 * Subscribers to this event can:
 *  - ...
 *  - ...
 *  - Set properties on the user account that will be created, like user roles
 *    or a custom first name field (for example by populating it with data from
 *    the CAS attributes available in $casPropertyBag).

I've proposed something in the MR but we still need to weight on that and we need tests.

claudiu.cristea’s picture

joevagyok’s picture

Status: Needs work » Needs review

I pushed a basic test involving the CasHelper::EVENT_PRE_REGISTER event.

joevagyok’s picture

StatusFileSize
new3.64 KB

Uploading a patch file for composer patching.

claudiu.cristea’s picture

Issue tags: -Needs tests

Tests added

bkosborne’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me. Feel free to merge and release 2.3.2 claudiu.cristea

  • claudiu.cristea committed 4cc7a08a on 2.x
    Issue #3450140 by joevagyok, claudiu.cristea, bkosborne: Status property...
claudiu.cristea’s picture

Status: Reviewed & tested by the community » Fixed

Thank you

Status: Fixed » Closed (fixed)

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