[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Fixed the module calendar new to prevent breaking the entire page when...
"ushindi bienvenu \(@usbbush\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6923243bd6041_2a17f124411b5@gitlab-sidekiq-low-urgency-cpu-bound-v2-5d57c968f-p58tl.mail> |
ushindi bienvenu pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
f4b4326f by Espoir Baraka at 2025-11-23T15:00:15+00:00
[FIX] Fixed the module calendar new to prevent breaking the entire page when...
---
* [FIX] Fixed the module calendar new to prevent breaking the entire page when no calendar is available
See merge request tikiwiki/tiki!9098
- - - - -
1 changed file:
- modules/mod-func-calendar_new.php
Changes:
=====================================
modules/mod-func-calendar_new.php
=====================================
@@ -144,8 +144,23 @@ function module_calendar_new($mod_reference, $module_params)
$rawcals = $calendarlib->list_calendars();
if (empty($rawcals['data'])) {
- Feedback::errorAndDie(tra("You do not have permission to view the calendar"), \Laminas\Http\Response::STATUS_CODE_401);
+ Feedback::error(tra("No calendars found"));
+ return;
}
+
+ $rawcals['data'] = Perms::filter(
+ ['type' => 'calendar'],
+ 'object',
+ $rawcals['data'],
+ [ 'object' => 'calendarId' ],
+ 'view_calendar'
+ );
+
+ if (empty($rawcals['data'])) {
+ Feedback::error(tra("You do not have permission to view the calendar"));
+ return;
+ }
+
$moduleCalendarFocusdate = date("Y-m-d");
$rawcals['data'] = array_filter($rawcals['data'], fn($current) => in_array($current['calendarId'], $calIds));
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f4b4326f55b0aa5dccf3ee627b40ef81f43a5a6c
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f4b4326f55b0aa5dccf3ee627b40ef81f43a5a6c
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs