Problem/Motivation
When editing a view, the preview was not rendering.
I had this error:
Uncaught TypeError: can't access property "eventDrop", calendarOptions is undefined
buildCalendars https://calendar.mantra11.ddev.site/modules/contrib/fullcalendar/assets/js/fullcalendar.views.js?tifn4b:162
buildCalendars https://calendar.mantra11.ddev.site/modules/contrib/fullcalendar/assets/js/fullcalendar.views.js?tifn4b:156
attach https://calendar.mantra11.ddev.site/modules/contrib/fullcalendar/assets/js/fullcalendar.views.js?tifn4b:255
attachBehaviors https://calendar.mantra11.ddev.site/core/misc/drupal.js?v=11.4.4:166
attachBehaviors https://calendar.mantra11.ddev.site/core/misc/drupal.js?v=11.4.4:162
insert https://calendar.mantra11.ddev.site/core/misc/ajax.js?v=11.4.4:1406
jQuery 2
insert https://calendar.mantra11.ddev.site/core/misc/ajax.js?v=11.4.4:1398
commandExecutionQueue https://calendar.mantra11.ddev.site/core/misc/ajax.js?v=11.4.4:1048Issue fork fullcalendar-3611908
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mortona2k commentedI used claude to come up with a patch.
I don't completely understand what is happening, but looks like an issue with how drupal_static() is being used.
Otherwise, the change looks clean to me, and has good comments above the new code.
The preview is now working for me.
Comment #4
mandclu commentedI asked Claude to explain the proposed code changes:
Symptom: In Views UI preview, the calendar fails to render with a JS error: can't access property 'eventDrop', calendarOptions is undefined, thrown from buildCalendars() in fullcalendar.views.js.
Root cause (confirmed against the current code):
The proposed fix (MR !112)
Evaluation
This is the right fix, not a workaround. A couple of points worth noting rather than red flags:
Comment #6
mandclu commentedThanks for the work here. I was able to reproduce the problem, and verified that the fix solved it. Merged in.
I considered adding the suggested JS debugging line, but ultimately decided that if included it should probably be kept behind a debugging flag. That likely warrants a broader discussion, so leaving that for a separate issue.