error backing up courses - "setting_invalid_ui_label"

Re: error backing up courses - "setting_invalid_ui_label"

by Bernat Martinez -
Number of replies: 4

Has this been solved? I couldn't find any clues in a forum search 

We are having the same error/setting_invalid_ui_label problem when trying to perform an automated backup in Moodle 3.3 (PHP 7). 

Strangely enough  the same course backup successfully in Moodle 3.2 

Other courses in the same Moodle 3.3 backup successfully 

this is what we get when we try to backup 


Backing up Mates1ESO (IES Bellaguarda. Altea)...

... used 488 dbqueries

... used 0.5591151714325 seconds

Scheduled task failed: Automated backups (core\task\automated_backup_task),error/setting_invalid_ui_label

Backtrace:

* line 156 of /backup/moodle2/backup_section_task.class.php: call to base_setting_ui->set_label()

* line 153 of /backup/util/plan/base_task.class.php: call to backup_section_task->define_settings()

* line 60 of /backup/util/plan/base_plan.class.php: call to base_task->set_plan()

* line 160 of /backup/moodle2/backup_plan_builder.class.php: call to base_plan->add_task()

* line 187 of /backup/moodle2/backup_plan_builder.class.php: call to backup_plan_builder::build_section_plan()

* line 100 of /backup/moodle2/backup_plan_builder.class.php: call to backup_plan_builder::build_course_plan()

* line 163 of /backup/util/factories/backup_factory.class.php: call to backup_plan_builder::build_plan()

* line 62 of /backup/util/plan/backup_plan.class.php: call to backup_factory::build_plan()

* line 366 of /backup/controller/backup_controller.class.php: call to backup_plan->build()

* line 130 of /backup/controller/backup_controller.class.php: call to backup_controller->load_plan()

* line 374 of /backup/util/helper/backup_cron_helper.class.php: call to backup_controller->__construct()

* line 208 of /backup/util/helper/backup_cron_helper.class.php: call to backup_cron_automated_helper::launch_automated_backup()

* line 50 of /lib/classes/task/automated_backup_task.php: call to backup_cron_automated_helper::run_automated_backup()

* line 141 of /lib/cronlib.php: call to core\task\automated_backup_task->execute()

* line 67 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()

* line 81 of /admin/cron.php: call to cron_run()

In reply to Bernat Martinez

Re: error backing up courses - "setting_invalid_ui_label"

by Yusuf Badran -

In my case this error has been caused by having HTML tags in the topic titles.

Average of ratings: Useful (4)
In reply to Bernat Martinez

Re: error backing up courses - "setting_invalid_ui_label"

by Ken Task -
Picture of Particularly helpful Moodlers

Go to the course and see how the Section Names are done.

In looking at the debug trace - 1st item and the line it references:

$section_included->get_ui()->set_label(get_section_name($course, $section));

As @Yusuf has discovered, the error could be caused by errant HTML in Section Name.   Tags in HTML if not done properly with 'opening tags' and then 'closing tags' could be interpreted as 'redirects' (those are < or >) or as 'escapes' (the '\' character).

'spirit of sharing', Ken



Average of ratings: Useful (3)
In reply to Ken Task

Re: error backing up courses - "setting_invalid_ui_label"

by Ken Task -
Picture of Particularly helpful Moodlers

Follow up after testing with a 3.3 and a 3.2 ...

When editing a section, one has an option to use custom ... which means Moodle won't auto generate 'Topic 1', 'Topic 2', etc.  but, rather, whatever the user inserts.   The box for the Section Title won't accept HTML ... even if one manually inserts it (like <b> some text </b>).   But there is also a 'Summary' one can use under the Section Title that does allow HTML.

One might need to query the database to see what's in both of those objects:

select * from `mdl_course_sections` where `course` like "12"

The 12 in the example above is the ID of the course.

The output of that will show the attributes of all sections in course ID - both the Section Name and the Summary.   The Summary, if used and if teacher/editor used the HTML editor for the Summary, could have errant HTML tags that might be involved.

'spirit of sharing', Ken


Average of ratings: Useful (2)
In reply to Ken Task

Re: error backing up courses - "setting_invalid_ui_label"

by Yusuf Badran -

In my case, I am able to insert HTML into the Section Title, if it is done through the "Edit topic" page, but not with the quick-edit pencil.

It is currently working in version 3.3 and used to display fontawesome icons.

However, backing up and restoring becomes an issue.

I think there should be an option to allow HTML, similar to "formatstringstriptags" or included in the same setting:


Remove HTML tags from all activity names
Uncheck this setting to allow HTML tags in activity and resource names.

Remove HTML tags from all section and activity names
Uncheck this setting to allow HTML tags in section, activity and resource names.

Average of ratings: Useful (2)