I stumbled upon this problem this morning when trying to set a contextual filter on an unrelated view. For some reason I couldn't configure a contextual filter. I could add one but I couldn't get the settings UI overlay to render.

I checked my JS console and noticed that it was a series of AJAX errors so I started uninstalling Views Plugins. As soon as I disabled the Calendar views plugin, the contextual filter was operating again. The Calendar Datetime component of the module is still enabled.

Drupal core 8.0.1
Calendar 8.x-1.x-dev (2015-Dec-07)
PHP 5.5.30

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

awasson created an issue. See original summary.

awasson’s picture

Issue summary: View changes
Anonymous’s picture

When adding any contextual filter, the CalendarValidator::buildOptionsForm() gets called. But when trying to find a default replacement format on a non calendar argument, an error is thrown since the argument_wrapper is null:

Fatal error: Call to a member function getGranularity() on null in /var/www/html/modules/contrib/calendar/src/Plugin/views/argument_validator/CalendarValidator.php on line 68

Actually, I'm not sure why that validator defines a buildOptionsForm() in the first place.

tedbow’s picture

Status: Active » Needs review
FileSize
1.44 KB

When adding any contextual filter, the CalendarValidator::buildOptionsForm() gets called.

Ok I didn't know it would be called then here is patch that should fix it.

Actually, I'm not sure why that validator defines a buildOptionsForm() in the first place.

The option form is used to set the date format that will be used if the argument "title" twig replacement is used. The default templates use this for the views header.

Details here: #2625734: Create ability to override title based on Date argument with formated date

  • pjonckiere committed 6218d66 on 8.x-1.x authored by tedbow
    Issue #2632106 by tedbow: D8 Dev Calendar Views Plugin breaks Views AJAX...
Anonymous’s picture

Status: Needs review » Fixed
Issue tags: -views

Oh I see, so that was the right fix after all. Manually tested and it works as expected. The return in the getDefaultReplacementFormat() is not needed though, so I removed that on commit.

awasson’s picture

Perfect! That works just great.

Thanks,
Andrew

Status: Fixed » Closed (fixed)

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