[TikiWiki-commits] [Git][tikiwiki/tiki][30.x] [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 | <6a05b95e6f499_381908fc953e3@gitlab-sidekiq-low-urgency-cpu-bound-v2-c548dc657-snpmb.mail> |
Jonny Bradley pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki Commits: cd267d29 by Jonny Bradley at 2026-05-14T12:00:26+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 (cherry picked from commit 92f06278a17a7770aa4ef677003188583e2c3319) 8f5813e3 [FIX] calendars: Filter out empty elements before initializing a calendar in a module. Co-authored-by: Jonny Bradley <[email protected]> - - - - - 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/cd267d29b5c643b287a5e18cb6245438c3840e09 -- View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/cd267d29b5c643b287a5e18cb6245438c3840e09 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