Comments

primerg’s picture

Status: Active » Needs review
StatusFileSize
new1.75 KB

Please check the patch for this. Removed old hook function cod_session_link_alter() and used the cod_session_node_view_alter for d7

ezra-g’s picture

Status: Needs review » Needs work

Thanks for the patch! On a quick visual inspection of the patch:

We should be using user_is_anonymous() rather than working with the global $user object.

Also, please make sure that you follow general coding standards conventions such as FALSE instead of false.

primerg’s picture

Status: Needs work » Needs review
StatusFileSize
new1.73 KB

thanks for the quick review! resubmitting patch

saltednut’s picture

Status: Needs review » Reviewed & tested by the community

Patch applied cleanly. Was able to assign a session to user and noted that only THAT user was able to use the flag. Looks RTBC to me.

twardnw’s picture

Same here, patch applied clean, only speaker was able to set that flag.

primerg’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.85 KB

Please try again. while using this patch, noticed error "Undefined index: field_accepted in cod_session_node_view_alter()" error in the homepage. Also used unset instead of just leaving the title blank. This make sures there is no html printed if the flag is not present.

dsdeiz’s picture

Status: Reviewed & tested by the community » Needs review

Works here as well. It created a conflict on my end after applying the patch from #1668908: Replace User reference, Nodereference with References, Vertical session schedule view though. field_speakers became field_session_speakers and I changed $speaker['uid] to $speaker['target_id']. Heh, my bad. Didn't know references module has node_reference and user_reference modules.

mjonesdinero’s picture

Status: Needs review » Reviewed & tested by the community

patch also looks clean and it works for me.. also follow what on comment #7 said...

sheldonkreger’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +da_drupalcon

Tagging.

ezra-g’s picture

Status: Reviewed & tested by the community » Needs work

Following #1585752: Clearly indicate when a session has been declined, this causes a fatal error because we have 2 definitions of cod_session_node_view_alter().

As a general rule, it's also good to avoid working with the global $user object and to instead set an $account variable, to avoid changing the currently logged in user.

primerg’s picture

changes applied. also used the $account instead of the $user (not sure if that was the ideal way)

primerg’s picture

Status: Needs work » Needs review

changing status

twardnw’s picture

Status: Needs review » Reviewed & tested by the community

patch applies clean, functions as advertised

dsdeiz’s picture

Works on my end as well.

mjonesdinero’s picture

Work on my end also.. patch applies cleanly

ezra-g’s picture

Status: Reviewed & tested by the community » Needs work

In a functional test, this doesn't enforce that the session is actually scheduled - only accepted.

Also:
if ($speaker['uid'] == $account->uid) $presenter = TRUE;

Please follow the Drupal coding standards conventions for control statements (referenced above).

ezra-g’s picture

Assigned: Unassigned » ezra-g

I'm working to re-roll this.

ezra-g’s picture

Status: Needs work » Needs review
StatusFileSize
new3.56 KB

This patch:

- Corrects the functional & coding standards issues noted above
- Adds code comments to cod_session_node_view_alter().
- Defines new helper functions to determine whether a session is accepted, declined, whether a user is a speaker on a session.

ezra-g’s picture

Now with 100% less dpm ;).

japerry’s picture

Looks good, added the node:title token to the confirmation message because 'title' only doesn't work in d7 anymore.

ezra-g’s picture

Title: logged in user is being asked 'I confirm that I can present'… » Speaker confirmation shows incorrectly, add cod_session helper functions, update flag node title token
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.