From 17811cef2cc0828df18832b0541a70dd52281022 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 31 Jul 2009 11:14:16 +0000 Subject: [PATCH] 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 --- lib/outputlib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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'))); } -- 2.39.5