Commit b20e34e1 authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files

Fix bug where trying to call methods before safe_requiring

parent 3d22eb75
......@@ -152,6 +152,8 @@ function artefact_instance_from_type($artefact_type, $user_id=null) {
$user_id = $USER->get('id');
}
safe_require('artefact', get_field('artefact_installed_type', 'plugin', 'name', $artefact_type));
if (!call_static_method(generate_artefact_class_name($artefact_type), 'is_singular')) {
throw new ArtefactNotFoundException("This artefact type is not a 'singular' artefact type");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment