Commit b4b9f987 authored by Robert Lyon's avatar Robert Lyon Committed by Lisa Seeto
Browse files

Bug 1928506: Archive on release for page



When new submissions plugin is not installed

Completing the partial fix done in Bug 1926549

Change-Id: I516cf107ef07a8fc5e9a6fdf1c703b9590c9f16d
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 953cdd48)
parent 8809ba91
......@@ -1915,7 +1915,8 @@ class Collection {
$this->set('submittedtime', time());
$this->set('submittedstatus', self::SUBMITTED);
$this->commit();
if (is_plugin_active('submissions', 'module') && $group) {
safe_require('module', 'submissions');
if (PluginModuleSubmissions::is_active() && $group) {
PluginModuleSubmissions::add_submission($this, $group);
}
db_commit();
......
......@@ -1678,7 +1678,10 @@ class View {
try {
db_begin();
self::_db_pendingrelease(array($this->get('id')));
PluginModuleSubmissions::pending_release_submission($this, $releaseuser);
safe_require('module', 'submissions');
if (PluginModuleSubmissions::is_active()) {
PluginModuleSubmissions::pending_release_submission($this, $releaseuser);
}
require_once(get_config('docroot') . 'export/lib.php');
add_submission_to_export_queue($this, $releaseuser, $externalid);
db_commit();
......@@ -1699,7 +1702,10 @@ class View {
try {
db_begin();
self::_db_release(array($this->id), $this->get('owner'), $this->get('submittedgroup'));
PluginModuleSubmissions::release_submission($this, $releaseuser);
safe_require('module', 'submissions');
if (PluginModuleSubmissions::is_active()) {
PluginModuleSubmissions::release_submission($this, $releaseuser);
}
db_commit();
}
catch (Exception $e) {
......@@ -7044,7 +7050,8 @@ class View {
try {
db_begin();
self::_db_submit(array($this->id), $group);
if (is_plugin_active('submissions', 'module')) {
safe_require('module', 'submissions');
if (PluginModuleSubmissions::is_active()) {
PluginModuleSubmissions::add_submission($this, $group);
}
db_commit();
......
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