Error with activity update in 4.0.2

Error with activity update in 4.0.2

by James Asante -
Number of replies: 15

I have upgraded to Moodle 4.0.2 (Build: 20220711)

I get the error below when I try to update any activity or resource:
Coding error detected, it must be fixed by a programmer: The 'name' value must be set in other.

What should I do?




Average of ratings: -
In reply to James Asante

Re: Error with activity update in 4.0.2

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Enable Debugging on your site - all the way up to 'Developer' and tick display errors. Reproduce the error. Is a more detailed error trace produced?
In reply to Howard Miller

Re: Error with activity update in 4.0.2

by James Asante -
Here is the detail error when trying to update a label:

Coding error detected, it must be fixed by a programmer: The 'name' value must be set in other.

More information about this error

Debug info:
Error code: codingerror

Stack trace:
line 136 of /lib/classes/event/course_module_updated.php: coding_exception thrown
line 272 of /lib/classes/event/base.php: call to core\event\course_module_updated->validate_data()
line 161 of /lib/classes/event/course_module_updated.php: call to core\event\base::create()
line 693 of /course/modlib.php: call to core\event\course_module_updated::create_from_cm()
line 168 of /course/modedit.php: call to update_moduleinfo()
In reply to James Asante

Re: Error with activity update in 4.0.2

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

What's the PHP version? And what's the database type (MySQL, MariaDB, PostgreSQL or SQL Server) and version?

When updating a label update_moduleinfo() is called which in turn calls label_update_instance() and this function sets the 'name' property that gets passed to the course_module_updated event. This property is set to either the first 50 characters of the label text, or "Label" if the label has no text. So either way 'name' should never be blank.

Can you tell us some other activities that also result in this error?

In reply to Leon Stringer

Re: Error with activity update in 4.0.2

by James Asante -
Server=>Environment Report has OK (green) Status for all items
database = mysql (8.0.30)
php = 7.4.30

Error is returned for all Activities and Resources when Edit Settings => Save and display is applied

Below is another example of Forum

Coding error detected, it must be fixed by a programmer: Invalid component used in plugin/component_callback():mod_scheduler

More information about this error
Debug info:
Error code: codingerror
Stack trace:
line 8048 of /lib/moodlelib.php: coding_exception thrown
line 891 of /lib/grade/grade_item.php: call to component_callback_exists()
line 845 of /lib/grade/grade_item.php: call to grade_item->adjust_raw_grade()
line 1278 of /lib/gradelib.php: call to grade_item->regrade_final_grades()
line 383 of /course/modlib.php: call to grade_regrade_final_grades()
line 681 of /course/modlib.php: call to edit_module_post_actions()
line 168 of /course/modedit.php: call to update_moduleinfo()

Site address: trainingbundlelms.co.za
In reply to James Asante

Re: Error with activity update in 4.0.2

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
What is in mod/scheduler/version.php?

Mine, Moodle rel. 3.9, has this:
$plugin->version   = 2019120200;      // The current module version (Date: YYYYMMDDXX).
$plugin->release = '3.7.0'; // Human-friendly version name.
$plugin->requires = 2019052000; // requires Moodle 3.7.
$plugin->maturity = MATURITY_STABLE; // Stable branch MOODLE_37_STABLE
In reply to Visvanath Ratnaweera

Re: Error with activity update in 4.0.2

by James Asante -

I installed the scheduler plugin and now the Forum Edit settings error has changed to the following:

Coding error detected, it must be fixed by a programmer: The 'name' value must be set in other.

More information about this error

Debug info:
Error code: codingerror
Stack trace:
  • line 136 of /lib/classes/event/course_module_updated.php: coding_exception thrown
  • line 272 of /lib/classes/event/base.php: call to core\event\course_module_updated->validate_data()
  • line 161 of /lib/classes/event/course_module_updated.php: call to core\event\base::create()
  • line 693 of /course/modlib.php: call to core\event\course_module_updated::create_from_cm()
  • line 168 of /course/modedit.php: call to update_moduleinfo()


In reply to James Asante

Re: Error with activity update in 4.0.2

by Ken Task -
Picture of Particularly helpful Moodlers

Did you read the page for "more info' link?

https://docs.moodle.org/400/en/error/debug/codingerror

where is says:

"Coding errors (or coding_exceptions) are problems that are probably caused by incorrect code. For example, a plugin that does not communicate correctly with Moodle core."

That page also suggest that purging caches might make the error go away.

The environment check in Moodle checks for PHP version + extensions, MySQL/DB version,  DB character set/collation, etc.   Core stuff.   It doesn't check for compatibility of addons ... such as mod_scheduler.

Admin user should make a list of addons installed (like your /local/o365) and check the plugins site @ https://moodle.org/plugins/ to see if there is a compatible version of the plugin for the destination version of core.

The link to the mod_scheduler plugin shows it's compat up version 3.11 of moodle core code ... not the 4.0.2 to which you've upgraded.

Please see: https://moodle.org/plugins/mod_scheduler/versions

An incompatible plugin could cause above.

If you can login, go to: /admin/plugins.php?updatesonly=0&contribonly=1 and see what addons are installed and if any are in need of updating.

Mind sharing from what older version of Moodle did you upgrade to 4?

'SoS', Ken

In reply to James Asante

Re: Error with activity update in 4.0.2

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm a bit confused. You said you had an error which was clearly related to Scheduler - "Invalid component used in plugin/component_callback():mod_scheduler"

THEN... you said you installed Scheduler and got a different error. But the above error shows it was already installed. Can you explain exactly what you *did* do.

I'd be kind of surprised if the latest version of Scheduler fails in Moodle 4. There are some bug reports around testing it in M4 which leads me to believe that it most likely basically works. That is, of course, if you are running the latest version. As it's not technically compatible, the plugins check won't offer to upgrade it if you're running some ancient version.
In reply to Howard Miller

Re: Error with activity update in 4.0.2

by James Asante -
Hi Howard,
I had the Scheduler plugin activity in my 3.11 before the upgrade to 4.0.2. However, after the upgrade the scheduler plugin did not pull through and was showing not found on disk. What I did today, was to reinstall the 3.11 scheduler plugin which changed the error message of the Forum > Edit settings > Save and display to what I get for all other activities and resources "The 'name' value must be set in other."
In reply to James Asante

Re: Error with activity update in 4.0.2

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

One thing to check: you have some files and folders from previous Moodle versions. For example if you check the plugins overview page you probably have Health center (tool_health) and Quiz results (block_quiz_results) installed. Unless you installed these separately they shouldn't be present with Moodle 4.0.x – they were both present in Moodle 3.11.

So make sure you have got the Moodle 4.0.2 source code only. This is normally a process of:

  1. Move the files and folders from the Moodle source code folder into a backup folder.
  2. Download the source code from download.moodle.org and extract it into your Moodle source code folder.
  3. Copy config.php and any additional themes and plugins from the backup folder into the Moodle source code folder.
Average of ratings: Useful (1)
In reply to James Asante

Re: Error with activity update in 4.0.2

by Ken Task -
Picture of Particularly helpful Moodlers

When you upgraded, you did remember to copy from old code mods/blocks/themes addon directories to new code mods/blocks/themes addon directories?

mod_scheduler shows to be compatible up to 3.11
https://moodle.org/plugins/mod_scheduler/versions

'SoS', Ken

In reply to Ken Task

Re: Error with activity update in 4.0.2

by Alžbeta Juhásová -

The problem is in the Unicheck code - in the file plagiarism/unicheck/lib.php. In line "310 return" should be "return $data" .

Average of ratings: Useful (1)
In reply to Alžbeta Juhásová

Re: Error with activity update in 4.0.2

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

I think you're correct, following change MDL-74533 in Moodle 4.0.2 there are some plagiarism plugins causing this problem. I think that's also the cause in this thread, your reply pointed me to the likely cause.

Average of ratings: Useful (1)
In reply to James Asante

Re: Error with activity update in 4.0.2

by James Asante -
Thank you, Leon.
You have solved the problem. Please recommend its inclusion in future 4+ upgrades.

Regards
James