Hi there,

I am experiencing the above warning when scheduler is enabled and I edit or create any node which has scheduler enabled for that node.

It seems to be related to the user account but can't figure out what's wrong,

thanks

Comments

jonathan1055’s picture

Title: Undefined offset: 0 in scheduler_list_access_callback() (line 99...sites/all/modules/scheduler/scheduler.module) » Undefined offset: 0 in scheduler_list_access_callback()

Hi,
Yes you are right, this is an error. It must be related to our recent change in #1071976: Authenticated user to view list of own scheduled nodes. I'll check it now.

Jonathan

ps. I moved the 'line 99...sites/all/modules/scheduler/scheduler.module' out of the rather long title.

jonathan1055’s picture

Issue tags: -scheduler

Eric,
The problem is that we did not add parameters to the page_callback and access_callback in hook_menu(). One solution would be to add array(NULL, NULL) into the definition as below.

  $items['admin/content/scheduler'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Scheduled',
    'page callback' => 'scheduler_list',
    'page arguments' => array(NULL, NULL), // <<<<< this was missing
    'access callback' => 'scheduler_list_access_callback',
    'access arguments' => array(NULL, NULL),  // <<<<< this was missing
    'description' => 'Display a list of scheduled nodes',
    'file' => NULL,
  );
  $items['user/%/scheduler'] = array(
    'type' => MENU_LOCAL_TASK,
    'title' => 'Scheduled',
    'page callback' => 'scheduler_list',
    'page arguments' => array('user_only', 1), // This will pass the uid of the user account being viewed.
    'access callback' => 'scheduler_list_access_callback',
    'access arguments' => array('user_only', 1),
    'description' => 'Display a list of scheduled nodes',
    'file' => NULL,
  );

An alternative would be to test for isset($args[0]) in both the scheduler_list_access_callback() and scheduler_list() functions.

What's your preference?

Jonathan

Starminder’s picture

subscribe

eric-alexander schaefer’s picture

Status: Active » Fixed
jonathan1055’s picture

Status: Fixed » Patch (to be ported)

Thanks Eric.
Just in case it slipped your mind, we implemented this in D6 too, so the same fix is required.
Jonathan

eric-alexander schaefer’s picture

Status: Patch (to be ported) » Fixed

No, I did not forget D6. I did that on purpose!!!1! ;-)

http://drupalcode.org/project/scheduler.git/commit/fea0604

p.s. There should be a new issue status "fixed, again"...

Starminder’s picture

may 15 dev fixed it for me, thanks!

Status: Fixed » Closed (fixed)

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