Commit cba39269 authored by Doris Tam's avatar Doris Tam 🌷
Browse files

Bug 1911824: Change the copy setting for artefact annotation to 'nocopy'

Check that $evidences exist in case there exist evidenviews but no evidence blocks to copy

if the only block on a view is an annotation block, then make a check to not get the sql to run copies
which will result in error as there are no artefacts to copy.

Change-Id: Ie914704046c2396a2fedce958cef3a44dd28ae33
parent 291297fe
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -415,12 +415,11 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
        return $values;
    }

    public static function default_copy_type() {
    public static function default_copy_type(BlockInstance $instance, View $view) {
        if ($instance->get_view()->get('owner') == $view->get('owner')) {
            return 'fullinclself';
        }

    public static function ignore_copy_artefacttypes() {
        return array('annotationfeedback');
        return 'nocopy';
    }

    public static function has_feedback_allowed($id) {
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ class PluginBlocktypeBlog extends MaharaCoreBlocktype {
        );
    }

    public static function default_copy_type() {
    public static function default_copy_type(BlockInstance $instance, View $view) {
        return 'nocopy';
    }

+1 −1
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ class PluginBlocktypeBlogpost extends MaharaCoreBlocktype {
                     array('fieldname' => 'ctime', 'order' => 'DESC'));
    }

    public static function default_copy_type() {
    public static function default_copy_type(BlockInstance $instance, View $view) {
        return 'nocopy';
    }

+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ class PluginBlocktypeRecentposts extends MaharaCoreBlocktype {
        );
    }

    public static function default_copy_type() {
    public static function default_copy_type(BlockInstance $instance, View $view) {
        return 'nocopy';
    }

+1 −1
Original line number Diff line number Diff line
@@ -556,7 +556,7 @@ EOF;
        return $artefacts;
    }

    public static function default_copy_type() {
    public static function default_copy_type(BlockInstance $instance, View $view) {
        return 'nocopy';
    }

Loading