From: nicolasconnault Date: Fri, 31 Jul 2009 11:14:16 +0000 (+0000) Subject: MDL-19756 Outputting a debugging message if $OUTPUT->form() is called without $conten... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=17811cef2cc0828df18832b0541a70dd52281022;p=moodle.git MDL-19756 Outputting a debugging message if $OUTPUT->form() is called without $contents but with a $form->button set. Should use $OUTPUT->button($form) instead --- diff --git a/lib/outputlib.php b/lib/outputlib.php index baaf1a3586..53c14cb14e 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -2536,7 +2536,9 @@ class moodle_core_renderer extends moodle_renderer_base { $this->prepare_event_handlers($form); - if (empty($contents)) { + if (empty($contents) && !empty($form->button)) { + debugging("You probably want to use \$OUTPUT->button(\$form), please read that function's documentation", DEBUG_DEVELOPER); + } else if (empty($contents)) { $contents = $this->output_empty_tag('input', array('type' => 'submit', 'value' => get_string('ok'))); }