PlagiarismCheck / moodle-plagiarism_pchkorg

Plagiarismcheck.org is a sophisticated similarity search engine. We advocate for bringing technology into academics to help instructors save time and motivate students write better papers.
https://plagiarismcheck.org
GNU General Public License v3.0
13 stars 4 forks source link

The 'name' value must be set in other #25

Closed leonstr closed 2 years ago

leonstr commented 2 years ago

With Moodle 4.0.2 or later, when saving changes to an activity the error Coding error detected, it must be fixed by a programmer: The 'name' value must be set in other. appears.

To reproduce this:

  1. Create a course.
  2. Add a label (mod_label) to the course.
  3. Edit the label changing the text and click Save and return to course.

Results (with debugging enabled):

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()
leonstr commented 2 years ago

This issue arises following change MDL-74533 in Moodle 4.0.2 (1ecfc86) where the course_module_updated event is created after the plagiarism plugin callback instead of before.

Removing the empty function plagiarism_pchkorg_coursemodule_edit_post_actions() in plagiarism/pchkorg/lib.php and purging caches fixes the problem.

leonstr commented 2 years ago

Pull request added https://github.com/PlagiarismCheck/moodle-plagiarism_pchkorg/pull/26

tahirulamin commented 2 years ago

plz guide how to perform it Removing the empty function plagiarism_pchkorg_coursemodule_edit_post_actions() in plagiarism/pchkorg/lib.php and purging caches fixes the problem.

tahirulamin commented 2 years ago

function plagiarism_pchkorg_coursemodule_edit_post_actions($data, $course) { global $DB; $pchkorgconfigmodel = new plagiarism_pchkorg_config_model();

$config = $pchkorgconfigmodel->get_system_config('pchkorg_use');
if ('1' != $config) {
    return;

}
JaneAdelmann commented 2 years ago

This issue has been fixed with version 3.11.2

leonstr commented 2 years ago

@tahirulamin Try changing line 201 of lib.php from return; to return $data;. See #27 for more information, I opened that new issue as it's a slightly different manifestation of this original issue.

JaneAdelmann commented 2 years ago

The version of moodle plugin v3.11.3 has this line changed. https://github.com/PlagiarismCheck/moodle-plagiarism_pchkorg/blob/master/lib.php#L201 You can just update your version of moodle plugin.

Thank you for cooperation.