Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.1, 3.1.3
-
MOODLE_31_STABLE
-
MOODLE_31_STABLE
-
MDL-57169_master -
Description
Steps (with debug active):
- Insert an image in category description
- Start a restore by course backup
- The debug error message is displayed
=========================================================
Before calling format_text(), the content must be processed with file_rewrite_pluginfile_urls()
line 1313 of /lib/weblib.php: call to debugging()
line 746 of /backup/util/ui/renderer.php: call to format_text()
line 319 of /lib/outputrenderers.php: call to core_backup_renderer->render_restore_category_search()
line 283 of /backup/util/ui/renderer.php: call to plugin_renderer_base->render()
line 535 of /backup/util/ui/restore_ui_stage.class.php: call to core_backup_renderer->course_selector()
line 129 of /backup/restore.php: call to restore_ui_stage_destination->display()
=========================================================
In order to fix it:
In file /backup/util/ui/renderer.php change the next lines (method render_restore_category_search):
$row->cells = array( |
html_writer::empty_tag('input', array('type' => 'radio', 'name' => 'targetid', 'value' => $category->id)), |
format_string($category->name, true, array('context' => context_coursecat::instance($category->id))), |
format_text($category->description, $category->descriptionformat, array('overflowdiv' => true)) |
);
|
By:
$context = context_coursecat::instance($category->id); |
$row->cells = array( |
html_writer::empty_tag('input', array('type' => 'radio', 'name' => 'targetid', 'value' => $category->id)), |
format_string($category->name, true, array('context' => context_coursecat::instance($category->id))), |
format_text(file_rewrite_pluginfile_urls($category->description, 'pluginfile.php', $context->id, 'coursecat', 'description', null), $category->descriptionformat, array('overflowdiv' => true)) |
);
|