Problem/Motivation

We should use the new HostEntity::isAvailableForRegistration in RegisterAccessCheck.

Then we will not need web/modules/contrib/registration/modules/registration_admin_overrides/src/Access/RegisterAccessCheck.php at all.

If we do #3497728: HostIsOpen constraint should add cache expiry metadata we can also remove the code from the RegisterForm that displays additional validation methods, as no one will ever be able to see them.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

jonathanshaw created an issue. See original summary.

kul.pratap’s picture

@jonathanshaw The HostEntity::isAvailableForRegistration method is not present in either the HostEntity.php class or the HostEntityInterface.php. Should we implement this function first to use it in RegisterAccessCheck? Additionally, could you provide some details on what functionality this method should perform?

jonathanshaw’s picture

Status: Active » Postponed
jonathanshaw’s picture

jonathanshaw’s picture

Status: Postponed » Active

isAvailableForRegistration() is now in 3.3.x-dev HEAD.

kul.pratap’s picture

Assigned: Unassigned » kul.pratap
john.oltman’s picture

Status: Active » Postponed

Please hold on this as it will likely become a won't do along with #3497728. Will explain end of week.

john.oltman’s picture

Assigned: kul.pratap » Unassigned
Status: Postponed » Closed (works as designed)

I'm closing this because it has serious side effects reduces flexibility for site builders:

1) As noted in the comments for #3464736, "sometimes it's confusing to users to hide options that previously existed". The existing access control gives site admins the option to keep the register route enabled after the close date, or if capacity is reached, so that messages on the register page can explain why registration is no longer allowed. Completing this task would remove that as an option.

2) It creates performance issues when combined with #3497728. I left a comment on that issue with further explanation.

john.oltman’s picture

I edited my previous comment, since I misread the proposal for cache expiry based on open/close dates. I still think we should not do this task though, as noted. We can reopen if there is a compelling counter argument.

jonathanshaw’s picture

Interesting. I'm broadly sympathetic to what you're saying.

So we actually have 3 scenarios currently:
- by default, the register links or tabs are always shown
- if the site owner enables set_and_forget then they are shown/hidden based on open/close alone (not capacity)
- a developer could chang the route access and use HostEntity::isAvailableForRegistration()

I will leave this as closed, and have related discussion in #3499231: Show causes with registration link and form and #3497731: Deprecate the "set and forget" feature.