I use fullcalender alpha 7 in combinations with entity attach views.
When buidling my view i receive an error saying.
Notice: Undefined offset: 0 in fullcalendar_check_arguments() (regel 221 van sites/all/modules/contrib/fullcalendar/theme/theme.inc).
Changing and checking variables fixes this.

else {
    $args[] = $view->args[$position];
}
else {
      if(isset($view->args[$position])){
        $args[] = $view->args[$position];
      }
    }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mallezie’s picture

FileSize
413 bytes

Patch attached

aspilicious’s picture

First of all, hello Tim :).

Hmm I'm not sure this is the correct patch...

Could you provide the values (or a screenshot) from the $view->argument and $view->args array? (devel output)
(try the awesomescreenshot plugin for chrome)

If I understand this error, the $view->argument array isn't empty but $view->args is.

Thnx!

mallezie’s picture

FileSize
528.86 KB

Your understanding of the error is correct. I don't know if it's the right solution, but it hides the error, and does not break anything ;-)

requested screenshot attached

aspilicious’s picture

Hmm I need one more dpm. Could you place dpm($handler) in the foreach.
I maybe have a better patch...

mallezie’s picture

FileSize
449.09 KB

screenshot attached

aspilicious’s picture

Status: Active » Needs review
FileSize
796 bytes

This patch preserves the arguments.
Can you give this a try?

tim.plunkett’s picture

@mallezie,

Can you paste (http://paste.pocoo.org/) an export of your view? I'd really like to recreate this myself and debug it, changing that code might break other things in strange ways, I just want to be sure.

mallezie’s picture

doesn't seem to work.
I attached a screenshot with dpm($handler) after else.
dpm($handler) doesn't seem to have an argument.
Shouldn't it be

if(isset($handler->argument))
mallezie’s picture

FileSize
317.55 KB

and with screenshot ;-)

aspilicious’s picture

Yeah it needs the isset.

Thnx for all the info. If you can export the view for tim.plunkett (see #7) we will fix this as soon as possible.

mallezie’s picture

FileSize
32 KB

I've exported two views.
First create's list of entity's with calenders attached.

Second one is calender view (which is attached to first view ;-)
http://paste.pocoo.org/show/497948/

I've attached a (untested) feature with the necessary content type and view, if that's easier.
Something i found, which i don't know if it's related. Is that the css files aren't loading correctly when ajax is used in one of the views.

(The attachment is a tar, renamd tot tar.gz cause of extension filtering)

tim.plunkett’s picture

Status: Needs review » Closed (cannot reproduce)

Even with the entire feature, I still could not reproduce the bug.

As with the other issue, thanks for the bug report. If you continue to have this problem and can provide more information to reproduce, please reopen the issue.

aspilicious’s picture

Status: Closed (cannot reproduce) » Active
aspilicious’s picture

Status: Active » Needs review
FileSize
809 bytes
Ganganation’s picture

Thanks aspilicious for putting me on the right track.
I've seen this problem/page before but didn't identify it as the same issue.
Tried the argument-fix, that works, only problem is that right now it doesn't show any data (that could also be my settings off-course).
I will try to create a new view, let's see if it works right than.

Ganganation’s picture

Created the new view, data will only display without the fullcalendar format.
What can I do?

Thanks in advance :D

aspilicious’s picture

Export your view and settings needed for the view

Ganganation’s picture

FileSize
76.09 KB

This is the exported view (see attachement), where can I find the needed settings for the view?

aspilicious’s picture

What version of views/ctools are you running?

Ganganation’s picture

Views: 7.x-3.0-rc1
Ctools: 7.x-1.0-rc1

aspilicious’s picture

Hmm No time to dig deeper now.
Maybe Tim can find the damn error

Ganganation’s picture

Thanks for your time aspelicious, I hope Tim can find anything.
I will be looking as well ;)

Ganganation’s picture

I at least got my data back (not a solution for this problem)
I removed the module completely.
1. I disabled the module
2. I went to uninstall the module
3. Empty all cashes

After that I did a check for available updates and it showed me the update for fullcalendar (strange...)
I installed that and after that empty all cashes. And that worked!

Ganganation’s picture

After I applied the #14 patch it still displayed an error:

Notice: Undefined property: date_views_argument_handler_simple::$argument in fullcalendar_check_arguments() (regel 227 van /home/deb32896/domains/egs-sneek.nl/public_html/sites/all/modules/fullcalendar/theme/theme.inc).
Notice: Undefined property: date_views_argument_handler_simple::$argument in fullcalendar_check_arguments() (regel 228 van /home/deb32896/domains/egs-sneek.nl/public_html/sites/all/modules/fullcalendar/theme/theme.inc).

After looking around a little I found the following simple solution:

- if ($date_handler) {
+ if (isset($date_handler->argument)) {

And that worked :D Hope this helps!

tim.plunkett’s picture

Status: Needs review » Postponed (maintainer needs more info)

@Ganganation please try with Views RC3 and the latest dev of fullcalendar. Sorry that you are still having this problem.

tim.plunkett’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
Ganganation’s picture

After updating to beta 2, I got the same errors, after applying patch #14 & my own fix #24 the problem was fixed again.

Hope this helps.

function fullcalendar_check_arguments($view) {
  $date_handler = NULL;
  $args = array();
  $settings = array('ajax' => FALSE);

  foreach ($view->argument as $argument_key => $handler) {
    if (date_views_handler_is_date($handler, 'argument')) {
      $date_handler = $handler;
      $args[] = 'fullcalendar_browse';
    }
    else {
      if(isset($handler->argument))
        $args[] = $handler->argument;
    }
  }

  if (isset($date_handler->argument)) {
    $date_range = explode('--', $date_handler->argument);
    $timestamp = strtotime($date_range[0] . " +1 month");

    // Add ajax for date argument.
    $settings['args'] = implode('|', $args);
    $settings['ajax'] = TRUE;

    // Settings for FullCalendar.
    $month = date('n', $timestamp);
    $year = date('Y', $timestamp);
    $settings['date']['month'] = $month - 1;
    $settings['date']['year'] = $year;
  }

  return $settings;
}
RuiMendes’s picture

also happend to me.

applying both patches worked.

Ganganation’s picture

Status: Closed (cannot reproduce) » Needs review

Still not fixed! After updating fullcallendar the same problem appears again, applying fix #14 & #24 will clear the problems.

Dean Mortimer’s picture

Status: Needs review » Needs work

Just ran across this problem as well:

Undefined offset: 0 in fullcalendar_check_arguments() (line 689 of E:\wamp\www\drupal-7.9\sites\all\modules\fullcalendar\includes\fullcalendar.fullcalendar.inc).

I've turned off AJAX in the view for now as a workaround.

dagmar’s picture

Status: Needs work » Needs review
FileSize
507 bytes

I can reproduce this bug.

For example, when using Taxonomy Term as an argument, when no argument is provided, $view->args is empty.

This patch fix the problem.

tim.plunkett’s picture

Status: Needs review » Closed (duplicate)