mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
Merge branch 'MDL-75358-master' of https://github.com/junpataleta/moodle
This commit is contained in:
commit
217819a0de
1 changed files with 3 additions and 3 deletions
|
@ -140,7 +140,7 @@ class blog extends base {
|
||||||
->add_joins($this->get_joins())
|
->add_joins($this->get_joins())
|
||||||
->set_type(column::TYPE_BOOLEAN)
|
->set_type(column::TYPE_BOOLEAN)
|
||||||
->add_fields("{$postalias}.attachment, {$postalias}.id")
|
->add_fields("{$postalias}.attachment, {$postalias}.id")
|
||||||
->add_callback(static function(bool $attachment, stdClass $post): string {
|
->add_callback(static function(?bool $attachment, stdClass $post): string {
|
||||||
global $CFG, $PAGE;
|
global $CFG, $PAGE;
|
||||||
require_once("{$CFG->dirroot}/blog/locallib.php");
|
require_once("{$CFG->dirroot}/blog/locallib.php");
|
||||||
|
|
||||||
|
@ -172,14 +172,14 @@ class blog extends base {
|
||||||
->set_type(column::TYPE_TEXT)
|
->set_type(column::TYPE_TEXT)
|
||||||
->add_fields("{$postalias}.publishstate")
|
->add_fields("{$postalias}.publishstate")
|
||||||
->set_is_sortable(true)
|
->set_is_sortable(true)
|
||||||
->add_callback(static function(string $publishstate): string {
|
->add_callback(static function(?string $publishstate): string {
|
||||||
$states = [
|
$states = [
|
||||||
'draft' => new lang_string('publishtonoone', 'core_blog'),
|
'draft' => new lang_string('publishtonoone', 'core_blog'),
|
||||||
'site' => new lang_string('publishtosite', 'core_blog'),
|
'site' => new lang_string('publishtosite', 'core_blog'),
|
||||||
'public' => new lang_string('publishtoworld', 'core_blog'),
|
'public' => new lang_string('publishtoworld', 'core_blog'),
|
||||||
];
|
];
|
||||||
|
|
||||||
return (string) ($states[$publishstate] ?? $publishstate);
|
return (string) ($states[$publishstate] ?? $publishstate ?? '');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Time created.
|
// Time created.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue