Problem/Motivation
Steps to reproduce
- Install Drupal 8.6.4
- Install
fullcalendarmodule. Make sure you have downloaded the library https://www.drupal.org/node/1056742 (library version ^3.3 I am using https://github.com/fullcalendar/fullcalendar/releases/tag/v3.9.0) - Install
big_pipemodule - Create a view with
FullCalendardisplay. You can follow the Drupal 7 steps here https://www.drupal.org/node/1237808, they are similar in Drupal 8 - Create a page display of the view, say path
/calendar - Create a block display of the view
- Place block in sidebar. Make sure that the block is not rendered in
/calendar
Expected behavior
I should see the calendar in block.
Actual behavior
The calendar is not rendered.
Investigation
Relevant JS files which integrates fullcalendar library with DOM:
// from fullcalendar.views.js
for (var dom_id in settings.fullcalendar) {
if (settings.fullcalendar.hasOwnProperty(dom_id)) {
if (typeof Drupal.fullcalendar.cache[dom_id] === "undefined") {
// This integrates the library with DOM
Drupal.fullcalendar.cache[dom_id] = new Drupal.fullcalendar.fullcalendar(dom_id);
}
}
}
// from fullcalendar.library.js
Drupal.fullcalendar.fullcalendar = function (dom_id) {
// skipped for simplicity...
this.$calendar.find('.fullcalendar').once().fullCalendar(this.$options);
// skipped for simplicity...
};
I found that the JS this.$calendar.find('.fullcalendar').once().fullCalendar(this.$options) is executed before the block DOM is loaded in the page. And due to this the library is unable to hook into the block, thus the calendar is not displayed.
The problem does not occur if I uninstall the big_pipe module.
More details:
webserver name and version: Apache 2.4
PHP version - PHP 7.2
Drupal version - 8.6.4
Proposed resolution
Remaining tasks
User interface changes
N/A
API changes
Data model changes
N/A
Comments
Comment #2
cilefen commentedWhich version of full calendar is in use? The official release is alpha stability.
Comment #3
subhojit777Comment #4
subhojit777@cilefen I have updated the issue summary. Please use library version ^3.3 I used https://github.com/fullcalendar/fullcalendar/releases/tag/v3.9.0
Comment #5
cilefen commentedThe module is alpha stability, released in 2013. Let’s move this to its queue.
Comment #6
orizonmedia commentedsame error here with latest dev release and fullcalendar libraries version 3.10...
UPDATE: I tried to switch to the alpha version and get another fatal error patched in the dev so nothing better. Also tried the module fullcalendar_library wich said it add the cdn if the libraries/fullcalendar not found but nothing worked libraries were not found. This module definitively need some work... If you need a calendar block based on fullcalendar lib install this module : https://www.drupal.org/project/fullcalendar_view
work like a charm!!
cheers
seb.
Comment #7
u_tiwari commentedPatch #162 here https://www.drupal.org/project/drupal/issues/1988968 seems to fix this issue.
Comment #8
dcam commentedI've volunteered to help clean up the FullCalendar issue queue. As part of that effort I'm closing issues open for unsupported versions of the module as "Closed (outdated)".
#7 makes it sound like this was possibly caused by an issue in Drupal Core. If this issue is still relevant for version 3.x of FullCalendar, then feel free to re-open it and update the issue version number.