[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] calendars: Filter out empty elements before initializing a calendar in a module.
"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a05b8f5b7cda_3819099c276e7@gitlab-sidekiq-low-urgency-cpu-bound-v2-c548dc657-965pv.mail> |
Jonny Bradley pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
92f06278 by Jonny Bradley at 2026-05-14T11:41:09+00:00
[FIX] calendars: Filter out empty elements before initializing a calendar in a module.
---
* [FIX] calendars: Filter out empty elements before initializing a calendar in a module.
For some reason window.moduleCalendar is set up with an empty array and this triggers an error (trying to `addListener` on null)
See merge request tikiwiki/tiki!10223
- - - - -
1 changed file:
- src/js/jquery-tiki/tiki-calendar.js
Changes:
=====================================
src/js/jquery-tiki/tiki-calendar.js
=====================================
@@ -15,6 +15,10 @@ $.fn.setupEventCalendar = function (
let isOpeningModal = false;
this.each(function () {
const calendarEl = document.getElementById(targetId);
+ if (!calendarEl) {
+ // check if element exists because an empty array is added to window.moduleCalendar for reasons i don't understand
+ return;
+ }
$(calendarEl).tikiModal(tr("Loading..."));
const toTimezoneStableIso = (dateValue) => moment(dateValue).format("YYYY-MM-DD[T]HH:mm:ssZ");
const browserTimezone = (() => {
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/92f06278a17a7770aa4ef677003188583e2c3319
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/92f06278a17a7770aa4ef677003188583e2c3319
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs