Hardcoded check for image block if a custom plugin specifies any blocktype, preventing installation + fix

Bug #639636 reported by Matt Gibson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Richard Mansfield

Bug Description

I'm coding a new artefact plugin and I've found that if I specify anything at all in the get_block_types() function of the main artefact class, installation fails because I haven't got class PluginBlocktypeImage available.

This comes from a loop in artefact_check_plugin_sanity() (/artefact/lib.php around line 1150), which reads

foreach ($types as $type) {
        $pluginclassname = generate_class_name('blocktype', 'image');

        // other stuff that's not relevant up to line 1168

        if (!class_exists($pluginclassname)) {
            throw new InstallationException(get_string('classmissing', 'error', $pluginclassname, $type, $pluginname));
        }
}

The plugin class name needs to generated dynamically:

$pluginclassname = generate_class_name('blocktype', $type);

Changed in mahara:
status: New → Fix Committed
importance: Undecided → Low
milestone: none → 1.4.0
Changed in mahara:
assignee: nobody → Richard Mansfield (richard-mansfield)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.