Properly checking if group template is a site template

Bug #1588606 reported by Robert Lyon on 2016-06-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
High
Robert Lyon
16.04
High
Unassigned
16.10
High
Robert Lyon

Bug Description

The $view->get('template') returns a string where as the constant View::SITE_TEMPLATE is an integer so we can't compare them via ===

We can use == as View::SITE_TEMPLATE = 2

Robert Lyon (robertl-9) wrote :

To test:

Make a new site and then try and edit the Administration -> Configure site -> Pages Group homepage template

you should get an error
[WAR] 80 (lib/errors.php:796) Failed to get a recordset: postgres8 error: [-2: ERROR: syntax error at or near "LIMIT"
LINE 1: SELECT * FROM "group" WHERE "id" = ? LIMIT 2
                                              ^] in EXECUTE("SELECT * FROM "group" WHERE "id" = ? LIMIT 2")
Command was: SELECT * FROM "group" WHERE "id" = ?

This is due to trying to get a group with no id: get_record("group", "id", null) at ../htdocs/view/blocks.php:92

Reviewed: https://reviews.mahara.org/6545
Committed: https://git.mahara.org/mahara/mahara/commit/e174049ba89ecf48247f32544c56d77e60f65e36
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit e174049ba89ecf48247f32544c56d77e60f65e36
Author: Robert Lyon <email address hidden>
Date: Fri Jun 3 16:48:10 2016 +1200

Bug 1588606: Properly checking for site templates

An oversite when Bug 1397110 was tested

behatnotneeded

Change-Id: I1772d27bb1ec099a26149551f82cf6ea365bb780
Signed-off-by: Robert Lyon <email address hidden>

Aaron Wells (u-aaronw) wrote :

I'm noticing some inconsistencies still:

1. Go to Administration -> Configure site -> Pages -> Edit group homepage

2. Notice how it has a "Display page" link, and links to the "edit content" screen, the "edit layout" screen, and the "choose skin" screen.

3. Click on the "edit layout" button

4. Notice how the "Edit layout" screen doesn't have a "Display page" link or a link to the "Choose skin" screen.

Expected result: The "Edit content" screen should be limited in the same way as the "Edit layout" screen.

The underlying problem here is that layout.php (which loads up the "Edit Layout" screen) correctly populates the "issitetemplate" smarty variable, but blocks.php (which loads the "Edit content" screen) does not. So although both screens use editviewtabs.tpl, they display it differently.

Aaron Wells (u-aaronw) wrote :

Spun off Bug #1590300 for those further issues.

Reviewed: https://reviews.mahara.org/6567
Committed: https://git.mahara.org/mahara/mahara/commit/fce3ece8edb988169ef7d748e2722107a5c362b3
Submitter: Robert Lyon (<email address hidden>)
Branch: 16.04_STABLE

commit fce3ece8edb988169ef7d748e2722107a5c362b3
Author: Robert Lyon <email address hidden>
Date: Fri Jun 3 16:48:10 2016 +1200

Bug 1588606: Properly checking for site templates

An oversite when Bug 1397110 was tested

behatnotneeded

Change-Id: I1772d27bb1ec099a26149551f82cf6ea365bb780
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit e174049ba89ecf48247f32544c56d77e60f65e36)

Robert Lyon (robertl-9) on 2016-10-21
Changed in mahara:
milestone: 16.10.0 → none
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers