Site pages and collections : Site unavailable error after enabling lti plugin.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Unassigned | ||
18.10 |
Fix Released
|
High
|
Unassigned | ||
19.04 |
Fix Released
|
High
|
Unassigned | ||
19.10 |
Fix Released
|
High
|
Unassigned |
Bug Description
Hi,
I use Mahara 18.10.1 on ubunto 16.04.3, php 7.0.8, apache2 and Postgres 10.6.
After enabling LTI plugin , and logging as a non-admin user , if we visit pages and collections page, it will through site unavailable error.
Steps to reproduce
* Visit the site.
* Make sure we have enabled the LTI Plugin.
* Login as a non-admin user.
* Go to the Pages and collections page(Main menu->Create->Pages and Collections)
* Site unavailable Error
More precisely,On switching on the debug mode We are getting this error because of an Sql Exception after swtiching on the lTI plugin.It says group by is required while selecting a.id (lti as a )when using aggregate function.
Here goes the git diff output:
diff --git a/htdocs/
--- a/htdocs/
+++ b/htdocs/
@@ -4168,8 +4168,9 @@ class View {
if (!empty($groupby)) {
- $groupby .= ', g.id, h.wwwroot';
- $collgroupby .= ', g.id, h.wwwroot';
+ // CATALYST CUSTOM - adding groupby condition for lti_assessment id column.
+ $groupby .= ', g.id, h.wwwroot' . ($haslti ? ', a.id' : '');
+ $collgroupby .= ', g.id, h.wwwroot' . ($haslti ? ', a.id' : '');
}
$sort = '
To correct this problem we need to add the LTI (a.id) in the group by condition(with a condition if LTI is enabled)
Patch for "master" branch: https:/ /reviews. mahara. org/10252