我正在尝试为我的功能增强创建Moodle自定义服务
1 ) https://docs.moodle.org/dev/External_functions_API
2 ) https://docs.moodle.org/dev/Adding_a_web_service_to_a_plugin
根据这些文档更新了业务模块。创建了服务模块和external_lib.php文件。但是我在访问web服务API时出现了错误
错误:{"异常":"dml_missing_record_exception","错误代码":"invalidrecord"、"消息"在数据库表external_functions中找不到数据记录。}
启用调试模式并重试。显示外部函数注册错误。
{"exception":"dml_missing_record_exception","errorcode":"invalidrecord","mess age"
:"Can not find data record in database table external_functions.","debuginfo":"SELECT * FROM {external_functions
} WHERE name = ?n[array (n 0 => 'local_enroll_course',n)]"}
如何在Moodle中注册新创建的服务?请帮助
您需要在version.php中增加版本号,然后转到Moodle中的Notifications并运行升级。然后Moodle将识别您添加到externallib.php和db/services.php