I've been bashing my head against the wall for a few days now.
It seems that this module supports users registering for a node and then be able to view, and potentially delete, their own registration.
I've gotten as far as users having a registration form on the node itself (and/or in a "Registration" tab on the node) and I've built a view to allow users to see how many people have registered so far.
I've given users the ability to update their own registrations, and even manage settings for them, but that only allows them to switch between registration states. Even then, it appears it wants to add a new registration, because enabling visibility of the "cancelled" state and having a user choose that state on the form and save registration only yields the message "you're already registered for this event".

What I want, and expected, was that once a user had created a registration vis a vis a node, the registration form would change to a form allowing them to update or delete that registration. But when it comes down to it, I can work around everything except the inability to somehow cancel/delete your own registration. I've double-checked the permissions a hundred times.

Help?

Comments

lachek’s picture

Update: On a brand new, clean install of Drupal 7.23 with minimal modules installed (Entity, Entity Registration), an authenticated user can register for a node as usual, then manually navigate to the resulting URL (e.g. http://server.com/registration/1). They then get an edit tab where they can delete their registration.

This is a very awkward way to handle deleting your registration. Not only would you need to know to go into the Edit tab, you'd also need a view somewhere to list your personal registration links, since they are otherwise hidden. I find it hard to believe that this is the typical way the module would provide a method for cancelling/deleting your registration.

Aside from that, I still cannot get the Edit tab with the Delete button to be visible on my main site, and I'm not sure what's interacting with Entity Registration to prevent it.

lachek’s picture

Update2: I've made a view that shows a user all their own registrations, and it includes a registration delete link, which makes the whole registration management thing a lot more user friendly than having to go to the Registration entity (as opposed to the node), and then Edit -> Delete (if that was possible).

However, the delete link only renders for the Administrative user, not for Authenticated users, in said view. This leads me to believe that once again, there is some permission error preventing users from deleting their own registrations, even though they explicitly have all the permissions to manage their own registrations for the registration type in the Permissions admin section.

If I could get a hand with figuring out what could hide the delete link besides not having the permission to delete one's own registration, I could likely make this quite UX friendly on my site.

albert volkman’s picture

I'm debugging this as well for a project I'm on. Where the form should be displaying a "Delete" option, it fails here-

http://drupalcode.org/project/registration.git/blob/refs/heads/7.x-1.x:/...

Which is called from here-

http://drupalcode.org/project/registration.git/blob/refs/heads/7.x-1.x:/...

I am unsure as to why a user who has "create" access to generate the initial registration, but not here.

lachek’s picture

Any updates or ideas regarding this? To summarize, I can't get anyone but the administrator user to see the link for Deleting their registration to a node.

DrCord’s picture

I am having the same problem, only admin users can delete an event registration, no matter the permissions I set.

ironbikers’s picture

Issue summary: View changes

Same problem for me. In " Permission" j've checked "Administer own settings" for autenticated users, but it doesn't work.

cceleya’s picture

I'm having this problem also, it would really make my life easier if there was a fix, or some alternative for this issue.

rag_gupta’s picture

Subscribing

rag_gupta’s picture

StatusFileSize
new74.7 KB

I've created a Views block which we can show in the left(as "Edit/Delete Registration") and it shows only for nodes for which a user has registered herself.

When creating Views Block select "Registration" types and add the block in the left sidebar.

If you want you can embed the block within the node too.

peter.morlion’s picture

This is the same issue as this one: https://www.drupal.org/node/2320171

peter.morlion’s picture

I've made a patch that seems to fix the issue, though someone with more knowledge of the project might best review it.

The fix is to make a separate access_callback for the 'Manage Registrations' callback. I also changed this link to 'Registrations', because a normal user will only be able to see the registrations and edit his/her own. An admin can still edit all registrations, access the Settings, and mail the registrants.

Mailing the registrations should probably have its own access logic, but that's another feature/patch.

peter.morlion’s picture

Status: Active » Needs review
Countzero’s picture

Tried the patch in #11, didn't change anything, even after cache clear.

So I set up a workaround. It's very simple and won't work for every case, but thought it my be worth sharing :

function nmrz_entity_view_alter(&$build, $type) {
  if ($type == 'node') { // Could test bundle also here
    global $user;
    
    // Basically, we look if there is a registration for this user on this entity ...
    $result = db_select('registration', 'r')
      ->fields('r', array('registration_id', 'user_uid', 'entity_id'))
      ->condition('user_uid', $user->uid)
      ->condition('entity_id', $build['#node']->nid)
      ->execute()
      ->fetchAssoc();
    
    // ... if yes, we output a link to the deletion page
    if ($result) {
      $build['deregister'] = array(
        '#type' => 'markup',
        '#markup' => "<a href='/registration/" . $result['registration_id'] . "/delete'>Annuler ma participation</a>",    
        // The sentence more or less means "Cancel my registration" in french.
        '#weight' => -100,
      );
    }
  }
}


BabaYaga64’s picture

Assigned: Unassigned » BabaYaga64
BabaYaga64’s picture

I also tried applying the patch from #11, but it didn't work and I got the white screen of death. I am not sure about the workaround in #13- I'm a bit of a newbie so not that familiar with how registration works.

BabaYaga64’s picture

Assigned: BabaYaga64 » Unassigned
greg boggs’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Needs review » Needs work
levelos’s picture

Status: Needs work » Closed (works as designed)

Permissions with registrations are admittedly complex. A user can view/edit/delete their own registration so long as they're the author of the registration. In other words, if they register themselves. If another user registers them, then they, by design, cannot manage their own registration. Take a look at registration_access() to see how all this works.

neograph734’s picture

That seems like a bad design to me. I somebody tells me they want to join I can register them, but then if they see they won't make it they can't cancel the registration, even it is for their account?
So they have to call me to edit the registration? That is strange in the least.

neograph734’s picture

There was a patch for this issue with additional permissions posted here: #2512982: Add permission to manage own registrations created by another account.