Commit d31993dd authored by Doris Tam's avatar Doris Tam Committed by Robert Lyon
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
(cherry picked from commit cba39269)
parent 69b378d1
......@@ -415,10 +415,17 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
return $values;
}
public static function default_copy_type() {
return 'fullinclself';
public static function default_copy_type(BlockInstance $instance, View $view) {
if ($instance->get_view()->get('owner') == $view->get('owner')) {
return 'fullinclself';
}
return 'nocopy';
}
/**
* To stop original annotation getting copies of the feedback
* when we copy a page
*/
public static function ignore_copy_artefacttypes() {
return array('annotationfeedback');
}
......
......@@ -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';
}
......
......@@ -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';
}
......
......@@ -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';
}
......
......@@ -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';
}
......
......@@ -15,6 +15,8 @@ $string['pluginname'] = 'Comment';
$string['Comment'] = 'Comment';
$string['Comments'] = 'Comments';
$string['comment'] = 'comment';
$string['artefactcomments'] = 'Artefact comments for block';
$string['viewcomments'] = 'Page comments';
$string['comments'] = 'comments';
$string['Details'] = 'Details';
$string['anddetails'] = 'and details';
......
......@@ -160,7 +160,7 @@ class PluginBlocktypeFiledownload extends MaharaCoreBlocktype {
return $element;
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'full';
}
......
......@@ -236,7 +236,7 @@ class PluginBlocktypeFolder extends MaharaCoreBlocktype {
return $element;
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'full';
}
......
......@@ -916,7 +916,7 @@ class PluginBlocktypeGallery extends MaharaCoreBlocktype {
public static function artefactchooser_element($default=null) {
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'full';
}
......
......@@ -121,7 +121,7 @@ class PluginBlocktypeHtml extends MaharaCoreBlocktype {
);
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'full';
}
......
......@@ -166,7 +166,7 @@ class PluginBlocktypeImage extends MaharaCoreBlocktype {
return ArtefactTypeFileBase::artefactchooser_get_file_data($artefact);
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'full';
}
}
......@@ -303,7 +303,7 @@ class PluginBlocktypeInternalmedia extends MaharaCoreBlocktype {
}
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'full';
}
......
......@@ -201,7 +201,7 @@ class PluginBlocktypePdf extends MaharaCoreBlocktype {
);
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'full';
}
......
......@@ -428,7 +428,7 @@ class PluginBlocktypeProfileinfo extends MaharaCoreBlocktype {
return $configdata;
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'shallow';
}
......
......@@ -205,7 +205,7 @@ class PluginBlocktypeSocialprofile extends MaharaCoreBlocktype {
return $configdata;
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'shallow';
}
......
......@@ -612,7 +612,7 @@ EOF;
return $element;
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'full';
}
......
......@@ -168,7 +168,7 @@ class PluginBlocktypeEntireresume extends MaharaCoreBlocktype {
return $return;
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'shallow';
}
......
......@@ -191,7 +191,7 @@ class PluginBlocktypeResumefield extends MaharaCoreBlocktype {
return $configdata;
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'shallow';
}
......
......@@ -225,7 +225,7 @@ class PluginBlocktypeCourseinfo extends MaharaCoreBlocktype {
'body' => get_string('plugininfo', 'blocktype.courseinfo'));
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'shallow';
}
......
......@@ -183,7 +183,7 @@ class PluginBlocktypeCreativecommons extends MaharaCoreBlocktype {
);
}
public static function default_copy_type() {
public static function default_copy_type(BlockInstance $instance, View $view) {
return 'full';
}
......
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