Problem/Motivation
Now that the validation system knows "causes" we have the ability to display better helpful messages in circumstances where HostEntity::isAvailableForRegistration() is preventing showing of a registration link or button.
RegistrationLinkFormatter is one obvious example, RegistrationFormFormatter another.
Proposed resolution
Remaining tasks
User interface changes
When "Registration link" or "Registration form" is chosen as the field formatter for the Registration field on the host entity view display, there is a new "Show reason when hidden" option in the formatter settings. If the host entity is a node, the path to manage the default display is /admin/structure/types/manage/<content_type_machine_name>/display.
API changes
Data model changes
Issue fork registration-3499231
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
john.oltman commentedComment #3
john.oltman commented@jonathanshaw, what UX did you have in mind for this. The issue I am running into is replacing a link or form with some text that says "Not open yet" doesn't work - not enough context. The full message "Registration for this event is not open yet" sort of works, but barely.
Comment #4
john.oltman commentedComment #5
jonathanshawI haven't thought about it enough to be sure. The problem you're describing makes sense.
How about something like:
For links:
Registration not available:
Cause1. Cause2.
For form:
Registration for this event is not available:
Cause1. Cause2.
It's all better than giving no explanation.
Comment #6
john.oltman commentedMakes sense, will proceed as outlined. I'm making it optional to have the causes via a field formatter setting, so existing sites are not impacted.
Comment #9
john.oltman commentedComment #11
john.oltman commentedComment #12
john.oltman commented