We're getting "Notice: Undefined index: UUID in user_alert_display_alert() (line 154 of [...]user_alert/user_alert.module)" repeatedly in our watchdog logs. So much so that we can't spot actual errors. It looks like the db_query is borked because the UUID cookie isn't set. Maybe we can add a conditional to test for the cookie.

Comments

Jeff Turman created an issue. See original summary.

Jeff Turman’s picture

StatusFileSize
new1.41 KB

It seems like the patch from https://www.drupal.org/node/1845918#comment-9228607 should have worked. However, this doesn't seem to do the trick for our site. But adding the conditional check to the user_alert_display_alert() method seems to fix it.

nsciacca’s picture

We also were seeing this notice in our logs. The patch above works, but the code that comes right after (shown below) to generate the output is wrapped in a cookie check anyways. So I don't see the point in even doing the query. The whole function could be wrapped in the check so if the UUID can't be loaded, don't query or display anything. I'm going to use this patch anyways because I don't have time make one. Thanks Jeff!

if (node_access('view', $alert) && isset($_COOKIE['UUID'])) {
  $output .= theme('user_alert', array('node' => $alert));
}
maikeru’s picture

The patch causes an additional error for postgres "Datatype mismatch: 7 ERROR: argument of AND must be type boolean, not type integer".

This seems to be because of "AND n.nid" is still included without the NOT IN.

But, nsciacca is correct, the current code seems to indicate user alerts won't be visible unless the cookie is set, so the first page load will not include user alerts.

maikeru’s picture

Attached updated patch, with removed second check for UUID cookie.

lisa.rae’s picture

I can confirm that the patch in #5 above resolved this error on our project.

lisa.rae’s picture

Status: Active » Needs review