MDL-69371 output: Allow null return for export_for_action_menu()

This commit is contained in:
Jun Pataleta 2021-10-21 18:14:47 +08:00
parent ca229dfcad
commit 1181f34253

View File

@ -123,10 +123,10 @@ class language_menu implements \renderable, \templatable {
* @param \renderer_base $output
* @return \stdClass action_menu data export.
*/
public function export_for_action_menu(\renderer_base $output): \stdClass {
public function export_for_action_menu(\renderer_base $output): ?\stdClass {
$languagedata = $this->export_for_template($output);
if (empty($languagedata)) {
return [];
return null;
}
$langmenu = new \action_menu();
$menuname = \get_string('language');