Problem/Motivation
Working on #3464736: Replace HostEntity::isEnabledForRegistration it was identified that it is extremely hard to understand how the waitlist validation event subscriber handles existing registrations correctly, and that there are probably edge cases it does not handle properly.
Possibly #3497722: Waitlist validation subscriber better as swapped plugin class might help simplify the logic here.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork registration-3497727
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
jonathanshawComment #3
jonathanshawComment #5
jonathanshawStudying this I've arrived at a conclusion:
(1) The current subscriber may be significantly broken, as shown by the failing test I've added.
(2) If we fix hasRoom() so it obeys its interface and returns a truthful answer instead of always returning true, then all the subscriber needs to do is to enhance the message/code if the waitlist is full.
(3) If the subscribers function is simple like this, then it makes sense as a subscriber and I don't see a particular need for #3497722: Waitlist validation subscriber better as swapped plugin class.
Comment #6
jonathanshawUnexpected test fail, needs more work.
Comment #7
jonathanshawComment #10
john.oltman commentedThis is a nice improvement, thanks @jonathanshaw.
There is a failure in phpcs that can be ignored re: use statements in the Drush command, it is due to a regression upstream in the coder contrib module, and the maintainers there are working to fix it.
For now, committing only to 3.3.x, pending discussion in #3497738: Roadmap for 3.4 release around the future of the 3.1.x branch.