Closed (fixed)
Project:
Drupal Commons
Version:
7.x-3.0
Component:
Events
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2013 at 17:10 UTC
Updated:
3 Apr 2013 at 16:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
victoria_b commentedComment #2
jpontani commentedThe attend button should be replaced with a cancel button. Make sure that the version of Commons Events you have is actually 7.x-3.0 (same with Commons).
Event node page:

Event teaser in stream:

Comment #3
jpontani commentedDidn't mean to set as fixed just yet.
Comment #4
victoria_b commentedHi jpontani,
Thank you for the quick response.
I downloaded and installed a fresh copy of Drupal Commons 7.x-3.0 and no cancel button appeared when booked onto an event with an authenticated user (Lisa Rex). I then booked onto the event as Admin and the cancel button appeared.
I proceeded to install the dev version of Commons Events 7.x-3.x-dev and again, when using Lisa Rex no Cancel button appeared. I upgraded Lisa Rex's role to an Admin and the cancel button appears.
Please see attached screenshots.
I'm using Acquia Dev Desktop on Windows 7 running Chrome, Firefox browsers.
I would try and use the latest version of "Drupal Commons 7.x-3.x-dev" but the download link is broken on the main project page.
Thank you.
Comment #5
jpontani commentedIt may be a permissions issue. The 'cancel' button will only show up if the user has permission to delete their registration. So in this case, the user needs the permission to 'delete own event registration'. Authenticated users should have that permission by default, but I'm looking into what else could cause this to not show up.
Comment #6
jfhovinne commentedLooks like a permission issue, since the cancel button appears after allowing authenticated users to 'delete any registration'.
But after investigation, in function
theme_commons_events_attending_event($variables = array())from file commons_events.theme.inc,registration_access('delete', $registration, $user, $registration->type)will always return FALSE for users without the 'delete any registration' permission because$authoris NULL.See registration_access in registration.module,
$author = $wrapper->author->value();The attached patch (adding author_uid in controller method) seems to fix the issue; authenticated users with 'delete own registration' permission are able to cancel their registration.
Also, if the permission is removed, the cancel button isn't displayed anymore.
Comment #7
jfhovinne commentedComment #8
alanburke commentedPatch works and does the trick
Comment #9
jpontani commentedGood catch, thanks! Committed to dev.
http://drupalcode.org/project/commons_events.git/commitdiff/eb0d866