
Problem/Motivation
Using computed fields for the availability, registration and waitlist counts is arguably a cleaner, centralised and more Drupal-y way of accessing these dynamic properties for an event instance.
Proposed resolution
Patch attached moves calculation of the properties to computed field plugins in the recurring_events_registration module. It uses the computed_field_plugin module to provide some convenient traits to make the classes definitions more compact.
The views integration is achieved by simply returning the value of the computed fields.
Remaining tasks
Use the computed fields in RegistrantForm as well.
Comment | File | Size | Author |
---|
Issue fork recurring_events-3264621
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
owenbush commentedThis is a nice idea. Thank you for raising the issue and providing the code. I'll take a look at it to review.
Comment #4
owenbush commented@bgilhome, I have created an MR from your patch, and added in the changed to RegistrantForm. It seems to be working for me. I like this idea so much that I may actually steal the idea and use it with the main module.
Comment #5
owenbush commentedI have updated the MR to remove the need for the computed_field_plugin, it didn't really provide much that the core ComputedItemListTrait didn't.
Comment #8
owenbush commentedThis has been merged into the 8.x-1.x and 2.0.x dev branches.