Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Commit

Permalink
validation on schedule config key
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Gomes committed Nov 1, 2019
1 parent 1903487 commit 4f1ea95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
$this->on('collections.entry.aside', function($name) use ($app) {
$canSchedule = $app->module('cockpit')->hasaccess('moderation', ['manage', 'schedule']);
$settings = $this->retrieve('config/moderation', ['schedule' => []]);
$scheduleEnabled = $canSchedule && ($settings['schedule'] === '*' || in_array($name, $settings['schedule']));

$scheduleEnabled = $canSchedule && isset($settings['schedule']) && ($settings['schedule'] === '*' || in_array($name, $settings['schedule']));

$this->renderView("moderation:views/partials/entry-aside.php", ['enabled' => $scheduleEnabled]);
});
Expand Down

0 comments on commit 4f1ea95

Please sign in to comment.