Commit 6459c465 authored by Robert Lyon's avatar Robert Lyon

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's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 098699bc
......@@ -2615,7 +2615,7 @@ class View {
public function bottomfreeposition() {
// get y of blocks at the bottom
$sql = 'SELECT MAX("positiony") FROM {block_instance_dimension} bid
INNER JOIN block_instance bi ON bi.id = bid.block
INNER JOIN {block_instance} bi ON bi.id = bid.block
WHERE bi.view = ?';
if ($maxy = get_field_sql($sql, array($this->get('id')))) {
// get max height in last row blocks
......
......@@ -479,10 +479,11 @@ function get_custom_theme_field($field) {
global $USER;
$institutions = $USER->get('institutions');
$theme_var = get_field_sql(
"SELECT sp.value FROM style_property sp JOIN institution i ON i.style = sp.style AND sp.field = ?
WHERE i.name IN ('" . join("','", array_keys($institutions)) . "')
ORDER BY i.name
LIMIT 1", array($field)
"SELECT sp.value FROM {style_property} sp
JOIN {institution} i ON i.style = sp.style AND sp.field = ?
WHERE i.name IN ('" . join("','", array_keys($institutions)) . "')
ORDER BY i.name
LIMIT 1", array($field)
);
return $theme_var;
}
......
......@@ -98,7 +98,7 @@ function allocate_client_connection_validate(Pieform $form, $values) {
if ($values['id'] > 0) {
if ($results = get_records_sql_assoc(
'SELECT cci.*
FROM client_connections_institution AS cci
FROM {client_connections_institution} AS cci
WHERE cci.name = ? AND
cci.id <> ? AND
cci.institution = ? ', array($values['name'], $values['id'], $values['i']))) {
......
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