Commit 1cd916ea authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Merge "Fix tests broken by recent changes (Bug #1324748)"

parents 1518871b 9585b824
......@@ -112,10 +112,6 @@ class PluginArtefactFile extends PluginArtefact {
// Create triggers to reset the quota notification flag
if (is_postgres()) {
$sql = "DROP FUNCTION IF EXISTS {unmark_quota_exeed_notified_on_update_setting}() CASCADE;";
execute_sql($sql);
$sql = "DROP FUNCTION IF EXISTS {unmark_quota_exeed_notified_on_update_usr_setting}() CASCADE;";
execute_sql($sql);
db_create_trigger(
'unmark_quota_exeed_notified_on_update_setting',
'AFTER', 'UPDATE', 'artefact_config', "
......
......@@ -1031,7 +1031,7 @@ class BlockInstance {
$old = get_records_assoc('view_artefact', 'block', $this->id, '', 'artefact, id');
delete_records('view_artefact', 'block', $this->id);
safe_require('blocktype', $this->get('blocktype'));
safe_require('blocktype', blocktype_name_to_namespaced($this->get('blocktype')));
if (!$artefacts = call_static_method(
generate_class_name('blocktype', $this->get('blocktype')),
'get_artefacts', $this)) {
......
......@@ -1768,6 +1768,8 @@ function db_create_trigger($name, $time, $event, $table, $body) {
if ($time != 'AFTER' || ($event != 'INSERT' && $event != 'UPDATE' && $event != 'DELETE')) {
throw new SQLException("db_create_trigger() not implemented for $time $event");
}
// Delete the trigger first, in case it already exists.
db_drop_trigger($name, $table);
if (is_postgres()) {
$functionname = $name . '_function';
$triggername = $name . '_trigger';
......
......@@ -1529,7 +1529,7 @@ function plugin_types_installed() {
function plugins_installed($plugintype, $all=false) {
static $records = array();
if (defined('INSTALLER') || !isset($records[$plugintype][true])) {
if (defined('INSTALLER') || defined('TESTSRUNNING') || !isset($records[$plugintype][true])) {
$sort = $plugintype == 'blocktype' ? 'artefactplugin,name' : 'name';
......
......@@ -45,10 +45,6 @@ class PluginNotificationInternal extends PluginNotification {
public static function postinst($prevversion) {
if ($prevversion == 0) {
// Delete the triggers first, in case they already exist.
db_drop_trigger('update_unread_insert', 'notification_internal_activity');
db_drop_trigger('update_unread_update', 'notification_internal_activity');
db_drop_trigger('update_unread_delete', 'notification_internal_activity');
// Add triggers to update user unread message count when updating
// notification_internal_activity
db_create_trigger(
......
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