The following error shows up when all caches are cleared (such as when a module is enabled), and Nodequeue, Smartqueue, and Smartqueue Taxonomy are enabled:

Notice: Undefined offset: 3 in nodequeue_handler_relationship_nodequeue->init() (line 19 of /document-root/sites/all/modules/nodequeue/includes/views/nodequeue_handler_relationship_nodequeue.inc).

I can't say whether it still occurs in 2.x-dev or 3.x-dev, since I haven't tested those versions. Also, it may occur when only Nodequeue is enabled - I just wanted to report that the others were enabled as well in my case.

The notice doesn't seem to have any negative effect, however.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rafinskipg’s picture

Notice: Undefined offset: 19 en nodequeue_handler_relationship_nodequeue->init() (línea 19 de D:\programs\wamp\www\patrimonio\sites\all\modules\contrib\nodequeue\includes\views\nodequeue_handler_relationship_nodequeue.inc).

Notice: Undefined index: nid in node_reference_field_prepare_translation() (line 977 of D:\programs\wamp\www\patrimonio\sites\all\modules\contrib\references\node_reference\node_reference.module).

Notice: Trying to get property of non-object in node_reference_field_prepare_translation() (line 981 of D:\programs\wamp\www\patrimonio\sites\all\modules\contrib\references\node_reference\node_reference.module).

I dont know whats the problem, but I have those errors on my site.

rafinskipg’s picture

Need help with

Notice: Undefined offset: 19 en nodequeue_handler_relationship_nodequeue->init() (línea 19 de D:\programs\wamp\www\patrimonio\sites\all\modules\contrib\nodequeue\includes\views\nodequeue_handler_relationship_nodequeue.inc).

kevster’s picture

Im getting this too with 7.2x beta 1 after clear cache and on various pages:

Notice: Undefined offset: 2 in nodequeue_handler_relationship_nodequeue->init() (line 19 of ...../web/www/sites/....../html/sites/all/modules/nodequeue/includes/views/nodequeue_handler_relationship_nodequeue.inc).

thx..

rafinskipg’s picture

I solved that problems deleting the views associated to the Nodeques.

The problem was that the nodequeue "X" had been deleted, but not the view.

amateescu’s picture

Ok, so the problem was that a View containing a Nodequeue relationship still exists after a queue has been deleted. I don't know if there's anything we can do about that, as views can also be manually created by a user, not only automatically by Nodequeue, so I'm inclined to say that it's the user's responsability to clean up.

Any other thoughts?

AndrzejG’s picture

OK, as it couldn't be reasonable to implement removing the view on the nodequeue removal.
But, if so, the warning should be added somewhere to remind the admin that she/he could remove the view manually.

InternetDevels’s picture

Appear notices in 7.x-2.x-dev version of module.

Notice: Undefined offset: 2 in nodequeue_handler_relationship_nodequeue->init() (line 20 of sites/all/modules/nodequeue/includes/views/nodequeue_handler_relationship_nodequeue.inc).

Fixed this issue.

quicksketch’s picture

Status: Active » Needs review

Thanks @InternetDevels.Com, fixes the problem for me. I was getting 10+ of these on almost every page of my site after upgrading from Drupal 6.

Status: Needs review » Needs work

The last submitted patch, nodequeue-no_set_el_array.patch, failed testing.

jonyprofit’s picture

Status: Needs work » Needs review

#7: nodequeue-no_set_el_array.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, nodequeue-no_set_el_array.patch, failed testing.

Alpay Beler’s picture

Any update on this issue?
I am getting a similar error Notice: Undefined index: leadership innodequeue_handler_relationship_nodequeue->init() (line 20 of/home/heritage/domains/**/public_html/sites/all/modules/nodequeue/includes/views/nodequeue_handler_relationship_nodequeue.inc).

Thanks.

cpelham’s picture

I am getting these errors also.

cpelham’s picture

Issue summary: View changes

added further explanation

othermachines’s picture

Title: Undefined offset error with nodequeue relationship handler » Undefined offset error with nodequeue relationship handler due to orphaned views
Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Issue summary: View changes
Status: Needs work » Needs review
FileSize
1.1 KB

This is still present in latest 7.x-2.x-dev. Here's a re-roll of the patch in #7 which resolves these errors.

Steps to reproduce

1. Install nodequeue and its dependencies.

2. Create a single nodequeue (admin/structure/nodequeue).

3. Go to Views admin (admin/structure/views) and select "Edit" next to nodequeue_1 (assuming it's the first nodequeue you've created).

4. Without changing anything, hit "Save". This overrides the "in code" view, meaning it won't be automatically deleted when the nodequeue is deleted.

5. Delete the nodequeue (admin/structure/nodequeue).

6. Clear all caches (admin/config/development/performance).

PHP notices displayed:

Notice: Undefined offset: 1 in nodequeue_handler_relationship_nodequeue->init() (line 20 of C:\wamp\www\test.dev\sites\all\modules\nodequeue\includes\views\nodequeue_handler_relationship_nodequeue.inc).
Notice: Undefined offset: 1 in nodequeue_handler_relationship_nodequeue->init() (line 20 of C:\wamp\www\test.dev\sites\all\modules\nodequeue\includes\views\nodequeue_handler_relationship_nodequeue.inc).

  • fizk committed 0725143 on 7.x-2.x authored by othermachines
    Issue #1436990 by InternetDevels, othermachines: Undefined offset error...
fizk’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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