Hi, i have this warning:

warning: Illegal offset type in isset or empty in /home/www/web68/web/sites/empresa.galiciadigital.com/modules/notifications/notifications.module on line 467.

What can i do?

Comments

gmak’s picture

I've got the same error (but referring to line 469). This appears on a node creation form for a CCK node.

jose reyero’s picture

Status: Active » Fixed

Since I'm doing some major rework and code clean up, It is a bit hard to follow line numbers. I think this one is fixed though in latest code. Please reopen if not (but mention the function name or piece of code too, please)

entrigan’s picture

I get the same error: "warning: Illegal offset type in isset or empty in /Applications/MAMP/htdocs/repo/k6/sites/all/modules/notifications/notifications.module on line 444."

       function notifications_event_enabled($key, $default = TRUE) {
          $info = variable_get('notifications_event_enabled', array());
#444  $status = isset($info[$key]) ? $info[$key] : $default;
           // If this has a parent type, will be enabled just if parent is
          if ($status && ($parent = notifications_event_types($key, 'parent'))) {
          return notifications_event_enabled($parent, FALSE);
          }
  else {
    return $status;
  }
}

Watchdog logs it twice, as follows:

Location http://localhost/repo/k6/node/add/farm
Referrer http://localhost/repo/k6/user/1/notifications
Message Illegal offset type in isset or empty in /Applications/MAMP/htdocs/repo/k6/sites/all/modules/notifications/notifications.module on line 444.

Location http://localhost/repo/k6/node/add/farm
Referrer http://localhost/repo/k6/node/add/farm
Message Illegal offset type in isset or empty in /Applications/MAMP/htdocs/repo/k6/sites/all/modules/notifications/notifications.module on line 444.

Hopefully that helps (btw this is with 4.x-dev checked out april 10th)

pribeh’s picture

I get it on every page. line 467 for me (April 14th beta1).

pribeh’s picture

I updated to latest Dev and now I get the following aloft a white screen :

Call to undefined function notifications_ui_build_links() in /var/www/blah.com/sites/all/modules/notifications_extra/notifications_nice/notifications_nice.module on line 21

Perhaps this is another issue.

pribeh’s picture

last (probably separate) bug reported in #5 goes away after updating to latest dev of both messaging and notifications. But bug reported in this issue remains :(

Thanks for your hard work guys.

pribeh’s picture

As of the recent April 26th Beta 2 update the illegal offset shifts to line 594.

pribeh’s picture

Status: Fixed » Active

I'm reopening since I'm still experiencing this.

gmclelland’s picture

I am experiencing this bug as well at line 594 using Beta 2 Messaging and Notifications.

I see it when I goto admin/messaging/notifications/events

It shows
* warning: Illegal offset type in isset or empty in /var/aegir/platforms/drupal/drupal-6.16/sites/dp2.devsites.com/modules/notifications/notifications.module on line 594.
* warning: Illegal offset type in isset or empty in /var/aegir/platforms/drupal/drupal-6.16/sites/dp2.devsites.com/modules/notifications/notifications.module on line 594.

Hope that helps

gmclelland’s picture

I think this might be caused by http://drupal.org/project/notifications_extra. When I disable those modules the error goes away. Is everyone else using this module? Just curious.

pribeh’s picture

Ya, it seems to be caused by certain notifications_extra modules. I still can't figure out which though.

jose reyero’s picture

Status: Active » Postponed

Ok, that kind of explains everything.

The notifications_extra pack is not up to date with latest 4.x-beta2. It will be in a few days (I think we'll skip beta2 ans sync it up to beta3).

Postponed till we can release next beta, later this week.

pribeh’s picture

Great stuff Jose. I'll test it as soon as beta 3 comes out. Thanks.

pribeh’s picture

Hi,

I've updated to the beta3 of both Messaging and Notifications, have uninstalled notifications_extra and now receive the following upon viewing a node (which is setup for allowing subscriptions):

Fatal error: Cannot use object of type Notifications_Subscription as array in /var/www/blah.com/includes/form.inc on line 893

okday’s picture

subscribing

carlitus’s picture

I have the same error when I enable the checkbox in the comment form:

Warning: Invalid argument supplied for foreach() in sites/all/modules/notifications/includes/object.inc on line 460

Fatal error: Cannot use object of type Notifications_Subscription as array in includes/form.inc on line 893

sethviebrock’s picture

subsc

sethviebrock’s picture

FYI downgrading to Beta 1 from B2 or B3 fixes the issue for me.

jose reyero’s picture

Status: Postponed » Fixed

Check out Beta 4

carlitus’s picture

Status: Fixed » Active

I've upgraded to beta 4 (messaging y notifications), then update.php and I've the same error:

Warning: Invalid argument supplied for foreach() in sites/all/modules/notifications/includes/object.inc on line 468

Fatal error: Cannot use object of type Notifications_Subscription as array in includes/form.inc on line 893

This only happens when I enable the checkbox in the comment form in admin/messaging/notifications/subscriptions/ui page

escoles’s picture

Confirming Carlitus's experiences: Also at beta 4 for messaging, notifications and notifications extras. as far as I can see, the only notifications extra module I have activated is auto-subscribe -- I get the Fatal Error when I try to create a comment while logged in as a user who is set to auto-subscribe.

jose reyero’s picture

Status: Active » Postponed (maintainer needs more info)

It's kind of weird because comment notifications, the ui and auto-subscribe are in the main notifications package, not in notifications_extra.

I'd need someone to enable the modules one at a time and let me know which is the one actually causing the issue.

pribeh’s picture

k, I'll try to do that this weekend.

hayk’s picture

Issue tags: +array warnings

I have similar issue nearly in every page

warning: Illegal offset type in isset or empty in sites\all\modules\notifications\notifications.module on line 612.

6.x-4.x-dev and older version

Provided is dump of variable $key in function notifications_event_enabled($key, $default = TRUE)

As you can see in function it is used as key for $info array, but it already an array and php dispatched warning.

Where this key generated and why it is array?

As i can see maybe roots of this error from notifications_array_info function.

$key = array (
  0 => NULL,
  1 => NULL,
  2 => NULL,
  'node-blog-insert' => 'node-insert',
  'node-blog-update' => 'node-update',
  'node-blog-comment' => 'node-comment',
  'node-poll-insert' => 'node-insert',
  'node-poll-update' => 'node-update',
  'node-poll-comment' => 'node-comment',
  'node-mass_contact-insert' => 'node-insert',
  'node-mass_contact-update' => 'node-update',
  'node-mass_contact-comment' => 'node-comment',
  'node-gallery-insert' => 'node-insert',
  'node-gallery-update' => 'node-update',
  'node-gallery-comment' => 'node-comment',
  'node-gallery_image-insert' => 'node-insert',
  'node-gallery_image-update' => 'node-update',
  'node-gallery_image-comment' => 'node-comment',
  'node-forum-insert' => 'node-insert',
  'node-forum-update' => 'node-update',
  'node-forum-comment' => 'node-comment',
  'node-panel-insert' => 'node-insert',
  'node-panel-update' => 'node-update',
  'node-panel-comment' => 'node-comment',
  'node-book-insert' => 'node-insert',
  'node-book-update' => 'node-update',
  'node-book-comment' => 'node-comment',
  'node-bschool-insert' => 'node-insert',
  'node-bschool-update' => 'node-update',
  'node-bschool-comment' => 'node-comment',
  'node-date-insert' => 'node-insert',
  'node-date-update' => 'node-update',
  'node-date-comment' => 'node-comment',
  'node-department-insert' => 'node-insert',
  'node-department-update' => 'node-update',
  'node-department-comment' => 'node-comment',
  'node-education_course-insert' => 'node-insert',
  'node-education_course-update' => 'node-update',
  'node-education_course-comment' => 'node-comment',
  'node-education_institution-insert' => 'node-insert',
  'node-education_institution-update' => 'node-update',
  'node-education_institution-comment' => 'node-comment',
  'node-kindergarten-insert' => 'node-insert',
  'node-kindergarten-update' => 'node-update',
  'node-kindergarten-comment' => 'node-comment',
  'node-language_course-insert' => 'node-insert',
  'node-language_course-update' => 'node-update',
  'node-language_course-comment' => 'node-comment',
  'node-page-insert' => 'node-insert',
  'node-page-update' => 'node-update',
  'node-page-comment' => 'node-comment',
  'node-profile-insert' => 'node-insert',
  'node-profile-update' => 'node-update',
  'node-profile-comment' => 'node-comment',
  'node-school-insert' => 'node-insert',
  'node-school-update' => 'node-update',
  'node-school-comment' => 'node-comment',
  'node-story-insert' => 'node-insert',
  'node-story-update' => 'node-update',
  'node-story-comment' => 'node-comment',
  'node-webform-insert' => 'node-insert',
  'node-webform-update' => 'node-update',
  'node-webform-comment' => 'node-comment',
  'node-insert' => NULL,
  'node-update' => NULL,
  'node-comment' => NULL,
);

anea02’s picture

I was experiencing the same issue. I disabled 'cck notifications' and the issue went away. Disabling this module also solved this issue for me: http://drupal.org/node/789444#comment-4725014

Regards

Adam

bsandor’s picture

I have the same message:
warning: Illegal offset type in isset or empty in /Applications/MAMP/htdocs/XXX/sites/all/modules/notifications/notifications.module on line 612.

Using:
Notifications 6.x-4.0-beta7
notifications_extra 6.x-4.0-beta5

messaging debug on
cck notifications off
nice links off
FeedAPI Subscriptions off
Message notifications off
Comment subscriptions off

Not using CCK Notifications.

Getting this message when I:
- create a node (node/add/event, node/add/signup [cck signup])
- when these nodes are created
- deleting same node

Not getting this error message when I create page or story types.

When I switch messaging debug off still have same message.

----------------
line 612 is the last line here:
function notifications_event_enabled($key, $default = TRUE) {
$info = variable_get('notifications_event_enabled', array());
$status = isset($info[$key]) ? $info[$key] : $default;

----------------
This error message disappears in each node types when I switch off 'Subscription settings' / 'Allowed subscription types' / 'Thread' respectively.

bsandor’s picture

I also use 'CCK Signup 6.x-1.0-beta2' with its 'CCK Sign-up notifications 6.x-1.0-beta2'.
I cant enable 'Event Reminder' on Notifications settings / Events / Configure.

(
warning: Illegal offset type in isset or empty in sites/all/modules/notifications/notifications.module on line 612.
)

-----------------------
I also noticed that immediate sending interval doesn't work but all the rest is working fine!!