Problem/Motivation

Working on [#] we identified a possible issue:
we want it to be the case that

if an administrator changes the number of spaces on a registration to exceed the maximum_spaces setting, then other custom fields on the registration can still be edited by the registrant without the registrant needing to reduce the spaces.

RegistrationWithinSpaces constraint needs to be checking the original registration. Or perhaps better using Registration::getAdditionalSpacesRequested() proposed in #3497959: Add a Registration::getSpacesRequested() method.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

jonathanshaw created an issue. See original summary.

jonathanshaw’s picture

Status: Active » Postponed

This uses Registration::getAdditionalSpacesRequested() so postponed on #3497959: Add a Registration::getSpacesRequested() method.

john.oltman made their first commit to this issue’s fork.

john.oltman’s picture

Status: Postponed » Needs review

I still need to add tests to prove an existing registration won't trigger the maximum spaces error in certain use cases. Otherwise you can take a look and see what you think. I'll get those tests added later today.

john.oltman changed the visibility of the branch 3497963-improve-maximum-spaces to hidden.

john.oltman’s picture

Test added, all set. If you look at the last pipeline, you'll see a failure on the last stage - that is from the "test-only changes" - I ran that to make sure I proved there was a real issue before - and then you can see the phpunit test with all the code from the MR, that passed. Not sure how familiar you are with "test only changes" but that means it applies just the test files in the MR and runs all tests - so you can prove that a problem really did exist.

This feels like a win to me, and would mean we could close #3497959: Add a Registration::getSpacesRequested() method.

jonathanshaw’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

john.oltman’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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