Skip to content

Commit

Permalink
Issue #46: Prevent fatal error on waitlist registration.
Browse files Browse the repository at this point in the history
  • Loading branch information
laryn authored Jan 31, 2025
1 parent 574d76b commit f35ea69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion includes/registration.forms.inc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function registration_form($form, &$form_state, Registration $registration) {
);
}

if ($host && entity_access('view', $registration->entity_type, $host)) {
if ($host && entity_plus_access('view', $registration->entity_type, $host)) {
$uri = entity_uri($registration->entity_type, $host);
if (isset($uri['path'])) {
$form['actions']['cancel'] = array(
Expand Down
4 changes: 2 additions & 2 deletions registration.module
Original file line number Diff line number Diff line change
Expand Up @@ -1849,8 +1849,8 @@ function registration_get_default_state($type = NULL) {
* If set, the type with the given name is returned.
*/
function registration_get_states($name = NULL) {
$types = entity_load_multiple_by_name('registration_state', isset($name) ? array($name) : FALSE);
return isset($name) ? reset($types) : $types;
$types = entity_load_multiple_by_name('registration_state', FALSE);
return (isset($name) && !empty($types[$name])) ? $types[$name] : $types;
}

/**
Expand Down

0 comments on commit f35ea69

Please sign in to comment.