I found the function cod_session_node_view_alter() called both in
cod_session_evaluations.module
cod_session.module

Renamed it to cod_session_evaluations_node_view_alter()

I also found this function cod_session_user_reviewed_session() is using the prefix cod_session instead of cod_session_evaluations but I did not add this in the patch. Is this something we have to change to?

Comments

twardnw’s picture

Issue tags: +da_drupalcon
StatusFileSize
new2.7 KB

patch applies clean, instance of cod_session_node_view_alter() in cod_session_evaluations is renamed properly.

IMO we should modify the other one as well (user_reviewed session), patch attached.

primerg’s picture

patch applied cleanly

saltednut’s picture

#1 applies cleanly with cod_session_node_view_alter() no longer being called twice

greggles’s picture

Status: Needs review » Reviewed & tested by the community

#1 applies cleanly but both #1 and the patch in the original post are necessary, right?

saltednut’s picture

No it appears that #1 is a continuation of #0.

Note this hunk from #1:

@@ -26,12 +26,12 @@ function cod_session_evaluations_form_session_evaluation_node_form_alter(&$form,
 /**
 * Implements hook_node_view_alter().
 */
-function cod_session_node_view_alter(&$build) {
+function cod_session_evaluations_node_view_alter(&$build) {
   global $user;
   $account = $user;
   // Hide the "Provide feedback on this session" links if the user has already
   // submitted a survey about this session.
-  if (cod_session_user_reviewed_session($account->uid, $build['#node']->nid)) {
+  if (cod_session_evaluations_user_reviewed_session($account->uid, $build['#node']->nid)) {
     unset($build['links']['nodereference_url']['#links']['session_evaluation_field_eval_session']);
   }
 }
twardnw’s picture

I rolled the changes done in patch #0 into my patch in #1

ezra-g’s picture

Status: Reviewed & tested by the community » Needs review

No it appears that #1 is a continuation of #0.

Could you clarify which single patch is the one we should test or if a new one needs to be rolled?

greggles’s picture

Status: Needs review » Reviewed & tested by the community

It's #1 and it's good to go.

japerry’s picture

Looks good!

ezra-g’s picture

Status: Reviewed & tested by the community » Fixed

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