Skip to content

Commit

Permalink
cleanup GHA test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Opitz committed Nov 8, 2023
1 parent 2b2f0ea commit 531b2f0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion block_news.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function fetch_news() : array {

// Return if no news.
if (!isset($template->tempnews)) {
return array();
return [];
}

// Sort news items by date for output.
Expand Down
8 changes: 4 additions & 4 deletions db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => [
'user' => CAP_ALLOW
'user' => CAP_ALLOW,
],
'clonepermissionsfrom' => 'moodle/my:manageblocks'
'clonepermissionsfrom' => 'moodle/my:manageblocks',
],
'block/news:addinstance' => [
'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
'manager' => CAP_ALLOW,
],
'clonepermissionsfrom' => 'moodle/site:manageblocks'
'clonepermissionsfrom' => 'moodle/site:manageblocks',
],
];
8 changes: 4 additions & 4 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Library for news.
*
* @package block_news
* @copyright 2023 onwards University College London <m.opitz@ucl.ac.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

/**
* Serve the files from the news file areas.
*
Expand Down Expand Up @@ -62,10 +62,10 @@ function block_news_pluginfile(
// Extract the filename / filepath from the $args array.
$filename = array_pop($args); // The last item in the $args array.
if (empty($args)) {
// $args is empty => the path is '/'.
// Hint: $args is empty => the path is '/'.
$filepath = '/';
} else {
// $args contains the remaining elements of the filepath.
// Hint: $args contains the remaining elements of the filepath.
$filepath = '/' . implode('/', $args) . '/';
}

Expand Down

0 comments on commit 531b2f0

Please sign in to comment.