Forums | Mahara Community
Support
/
Lost webservice functions since upgrade
20 August 2020, 22:55
Hi everyone,
since our upgrade to 20.04 our custom webservice functions are lost (module plugin). Any ideas what could have caused this? The plugin is installed and visible, just the related functions are missing (the plugin has not changed and on our development server it worked just fine). I tried to upgrade the plugin but unfortunately the functions weren't installed. Is there anything I can do to trigger the installation? Or do I have to uninstall the plugin completely and install again? If so, how can I do that? As far as I know I have to manually delete all related records from the database?
Thanks!
21 August 2020, 9:20
Hi Stefanie,
There is a function that is run on auth/webservice upgrade called external_reload_webservices() that cleans up 'dead' components, eg ones the system doesn't 'know' about.
Were your custom webservice functions applied via a custom module?
If so, then your module should have files like: https://git.mahara.org/mahara/mahara/-/tree/master/htdocs/module/mobileapi/webservice/
Where the services.php file defines the services and functions
And the functions directory contains the classes mentioned in the services.php file
If you need to get the Mahara system to reload the webservices again you can do the following:
1) edit htdocs/auth/webservice/version.php and increase the last digit of $config->version by 1, for example make 2018110800 be 2018110801
2) got to admin overview page - you should either be prompted to upgrade automatically or see an upgrade button for the auth webservice plugin
3) Upgrade it - this will trigger the external_reload_webservices() function to run again
4) set the value in step (1) back to it's old value
5) update the version number in the database back to the old number too, for example
UPDATE auth_installed SET version = '2018110800' where name = 'webservice';
Cheers
Robert
21 August 2020, 18:18
Hi Robert,
reloading the webservices did the magic! Thank you very much for your help.