- Issue created by @joelpittet
- π¨π¦Canada joelpittet Vancouver
This is trickier than I thought, after the access check allowing them through you run into:
Error: Call to a member function getSetting() on null in Drupal\registration\Plugin\Field\FieldWidget\RegistrationSpacesWidget->formElement() (line 71 of modules/contrib/registration/src/Plugin/Field/FieldWidget/RegistrationSpacesWidget.php).
- πΊπΈUnited States john.oltman
Interesting use case. Indeed, the module assumes a registration is for something (an event etc), and the host entity is that something. So it is not equipped to deal with it not existing or not configured. If not configured, wouldn't you just configure the host to fix? If not existing, you have a different problem. Soon the ability to "change host" will be live via a new
registration_change_host
submodule. This sounds like an opportunity to have that module allow for no old host - so a new one can be assigned. - π¨π¦Canada joelpittet Vancouver
@john.oltman, looking at the data there were only 8 events that had registrations where they were disabled after the event it would seem. I fixed those manually on D7 to deal with them. The real problem is where it looks like someone changed the registration type half way through, this is giving me similar access denied, it would seem. Maybe the check can be loosened? The saving grace here is that I can see the registration data on "View" even though I can't edit, so priority wise that mitigates the problem a bit.
- πΊπΈUnited States john.oltman
The bigger issue seems to be cases where the registration type was changed mid-way through, which appears to be causing access denied errors.
Are you referring to the value of the registration field on the host entity? Or the registration type assigned to various registrations.
- π¬π§United Kingdom jonathanshaw Stroud, UK
In \Drupal\registration\RegistrationAccessControlHandler::checkAccess, there is no explicit check to grant access to users with the 'administer registration' permission.
No. But we do have:
$result = parent::checkAccess($entity, $operation, $account);
And EntityAccessControlHandler checks this permission:
protected function checkAccess(EntityInterface $entity, $operation, AccountInterface $account) { ... if ($admin_permission = $this->entityType ->getAdminPermission()) { return AccessResult::allowedIfHasPermission($account, $admin_permission); } ... }
But we call that parent check AFTER we check for host/configured.