Commit 8c590b13 authored by Robert Lyon's avatar Robert Lyon

Bug 1718562: Stop the install/upgrade system from doing 'handle_event()'

As we don't need to record user interation at this point and it breaks
things on upgrade from old systems as some of the
tables/columns/sequences do not exist

behatnotneeded

Change-Id: I7d6f8969f9b94ba93761c0c25303e2e4916fa778
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent c2d55146
......@@ -1859,6 +1859,11 @@ function handle_event($event, $data, $ignorefields = array()) {
$event_types = array_fill_keys(get_column('event_type', 'name'), true);
}
if (defined('INSTALLER') && !isset($event_types[$event])) {
// Do not handle events not currently installed during upgrade
return;
}
$e = $event_types[$event];
if (is_null($e)) {
......
......@@ -1384,14 +1384,22 @@ class View {
if (array_search($accessrecord, $accessdata_added) === false) {
$accessrecord->view = $this->get('id');
$vaid = insert_record('view_access', $accessrecord, 'id', true);
handle_event('updateviewaccess', array(
'id' => $vaid,
'eventfor' => $item['type'],
'parentid' => $accessrecord->view,
'parenttype' => 'view',
'rules' => $accessrecord)
);
require_once('ddl.php');
$table = new XMLDBTable('view_access');
$field = new XMLDBField('id');
if (field_exists($table, $field)) {
$vaid = insert_record('view_access', $accessrecord, 'id', true);
handle_event('updateviewaccess', array(
'id' => $vaid,
'eventfor' => $item['type'],
'parentid' => $accessrecord->view,
'parenttype' => 'view',
'rules' => $accessrecord)
);
}
else {
$vaid = insert_record('view_access', $accessrecord);
}
unset($accessrecord->view);
$accessdata_added[] = $accessrecord;
}
......
......@@ -26,7 +26,7 @@ Scenario: As a user leaving a public comment on a group page (Bug 1509129)
And I set the following fields to these values:
| Comment notifications | None |
And I press "Save group"
When I click on "Pages" in the ".right-text" "css_element"
When I click on "Pages and collections" in the ".right-text" "css_element"
And I follow "Add"
And I click on "Page" in the dialog
And I set the following fields to these values:
......
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