Editor in course format field

Editor in course format field

by Franco Pantoja -
Number of replies: 2
Picture of Particularly helpful Moodlers

Hi,

ver 2.7

We would need a new field, editor, in our custom course format, to get extra information.

But nevertheless, in spite of  showing this element in the course edit form, we are not capable to get the value added in the editor, to be record in the database, in {course_format_options}.value

We are updating the corresponding course_format lib, in fact public function course_format_options($foreditform = false), adding a new item to the array

        'course_intro' => array(
        'label' => new lang_string('course_intro'),
        'element_type' => 'editor',
        'default' => 1,
        'type' => PARAM_RAW,
          ),

Does anybody help us??


Thanks in advance

Regards!!

Average of ratings: -
In reply to Franco Pantoja

Re: Editor in course format field

by Susana L. -

Same problem here.

I get something like:

Warning: mysqli::real_escape_string() expects parameter 1 to be string, array given in ....../lib/dml/mysqli_native_moodle_database.php on line 947

No errors if we use:

'element_type' => 'textarea'

In reply to Franco Pantoja

Re: Editor in course format field

by Susana L. -

Use 'element_type' => 'htmleditor' instead of 'editor'!