Download & Extend

Warning message triggered by immediate sends

Project:Notify by Views
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

After new content is created which triggers an immediate notification, the follow warning appears multiple times:
warning: in_array() [function.in-array]: Wrong datatype for second argument in /srv/www/vhosts/lis.luther.edu/htdocs/modules/notify_by_views/notify_by_views.module on line 345.

On my system, it appears 20 times -- equal to the number of views which are not enabled in Notify by Views.

Comments

#1

Status:active» needs review

I wasn't able to replicate directly, but I think I see what's happening. I've just committed a fix. Please give it a try.

Thanks for sticking with this; I haven't had as much time as I hoped with this module, but your testing and reports are a big help.

#2

After applying the patch, I saw the same results as before. However... I changed this:

foreach (variable_get('notify_by_views_select_views', array()) AS $key => $view_name) {
          if (!$key && !$view_name) continue; //bail if this is an unselected view

to this:

foreach (variable_get('notify_by_views_select_views', array()) AS $view_name) {
          if (!$view_name) continue; //bail if this is an unselected view

(lines 223-224) and the warning goes away! I don't think this will introduce other unusual behavior.

#3

Both are rough hacks.

I checked the key because I noticed that having no views selected could introduce an element with key = 0, value=1.

I know theres a smarter way to do this; I just haven't had time to think it through yet.

#4

To address the case you mention above, would (!$key || !$view_name) be the correct test?

#5

Status:needs review» needs work

Yes, although, I still think there a more elegant way to do it.

#6

that worked for me, thanks.

#7

Status:needs work» fixed

Using the OR check for now, as it does the job.

#8

Status:fixed» closed (fixed)

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

nobody click here