Unformatted table name breaks skin editing

Bug #1851176 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Unassigned
19.10
Fix Released
High
Unassigned
20.04
Fix Released
High
Unassigned

Bug Description

When you are in an institution with configurable theme (custom) set and the site database is using $cfg->dbprefix

You get the following error

Failed to get a recordset: postgres8 error: [-18: ERROR: relation "style_property" does not exist
LINE 1: SELECT sp.value FROM style_property sp JOIN institution i ON...
                            ^] in EXECUTE("SELECT sp.value FROM style_property sp JOIN institution i ON i.style = sp.style AND sp.field = ?
        WHERE i.name IN ('instone')
        ORDER BY i.name
        LIMIT 1")Command was: SELECT sp.value FROM style_property sp JOIN institution i ON i.style = sp.style AND sp.field = ?
        WHERE i.name IN ('instone')
        ORDER BY i.name
        LIMIT 1 and values was (0:headings)

to test:

1) Have clean database
2) in config.php set $cfg->dbprefix = 'cats';
3) install site
4) add an institution and set it's theme to 'Configurable theme' and make sure 'Page skins' is set to Yes
5) add a user to this institution
6) login as user and add a skin

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10557

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10557
Committed: https://git.mahara.org/mahara/mahara/commit/6459c465101d6242f47a5e65c53fb7e3f18ddd19
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit 6459c465101d6242f47a5e65c53fb7e3f18ddd19
Author: Robert Lyon <email address hidden>
Date: Mon Nov 4 12:44:20 2019 +1300

Bug 1851176: Adding a skin when on custom theme and using dbprefix

Get table not found error

Also fix for Bug 1851175 - as both fixes were to escape table name
correctly

Note: also fixed another table call that was not escaped correctly

behatnotneeded

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

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "19.10_STABLE" branch: https://reviews.mahara.org/10565

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10565
Committed: https://git.mahara.org/mahara/mahara/commit/3487188098b93f85493b92a58e55b8d6a03b6a22
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 19.10_STABLE

commit 3487188098b93f85493b92a58e55b8d6a03b6a22
Author: Robert Lyon <email address hidden>
Date: Mon Nov 4 12:44:20 2019 +1300

Bug 1851176: Adding a skin when on custom theme and using dbprefix

Get table not found error

Also fix for Bug 1851175 - as both fixes were to escape table name
correctly

Note: also fixed another table call that was not escaped correctly

behatnotneeded

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

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.