Valney Filho
Valney Filho

Reputation: 1

Invalid Record turn on Edit mode - Moodle 4.3

I recently upgraded Moodle to version 4.3, but the Edit mode option is showing an error when I try to activate it. The platform update didn't show an error; in the previous version, 3.9, it was working normally. As this is a core module of the system, what solution should be adopted?

SELECT * FROM {external_functions} WHERE name = ?
[array (
  0 => 'core_change_editmode',
)]
Error code: invalidrecord
* line 1658 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
* line 1634 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
* line 56 of /lib/external/classes/external_api.php: call to moodle_database->get_record()
* line 186 of /lib/external/classes/external_api.php: call to core_external\external_api::external_function_info()
* line 83 of /lib/ajax/service.php: call to core_external\external_api::call_external_function()

I've debugged the variables and I think this plugin is missing from the 'external_functions' table, but I haven't seen how to fix it

Upvotes: 0

Views: 130

Answers (1)

Russell England
Russell England

Reputation: 10241

Seems odd that the record is missing - The core_change_editmode service was added for Moodle 4.0

commit 09f6ce9fed752e47fc719228032aab075c526c09
Author: Bas Brands <[email protected]>
Date:   Tue Jul 6 10:01:05 2021 +0200

    MDL-71610 theme_boost: add a edit mode switch

The record should have been created during the upgrade to 4.3

I would try a re-run of the upgrade on a local/development site with a backup of the 3.9 site. But switch on debugging to developer level and check for errors.

In config.php add

@error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS!
@ini_set('display_errors', '1');    // NOT FOR PRODUCTION SERVERS!
$CFG->debug = (E_ALL | E_STRICT);   // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!
$CFG->debugdisplay = 1;             // NOT FOR PRODUCTION SERVERS!

If there are no errors, then check if the record exists after the re-run

SELECT *
FROM mdl_external_functions
WHERE name = 'core_change_editmode'

If it doesn't exist, then there is an issue with Moodle

If it does exist, then something has happened since the upgrade

Upvotes: 0

Related Questions