Custom landing page search broken in MySQL
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Cecilia Vela Gurovic |
Bug Description
The search box that allows you to choose the page to make a custom landing page doesn't work in MySQL. Note that it works fine in Postgresql.
Steps to reproduce:
Use MySQL as a db.
Have at least a site admin and one other user.
Log in as the site admin.
Create a site page called "Custom landing page".
Go to Configure site -> Site options -> Site settings and change the radio button for Custom landing page to yes.
Type 'Cu' or 'Custom landing page' into the Landing page text field.
Expected outcome:
The page you created called "Custom landing page" appears in the box.
You can save it.
If you log out and log in as the admin or the other user, you will see that page.
Actual outcome:
Nothing appears in the search box.
If you save the text 'Custom landing page', it is not linked to the page and nobody sees it when they log in.
If you hit the back button in the browser after attempting to save the landing page, you get a long SQL error:
WAR] 4f (lib/dml.php:517) Failed to get a recordset: mysqli error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ILIKE '%c%' OR g.name ILIKE '%c%' OR i.name ILIKE '%c%')
UNION
' at line 13] in EXECUTE("SELECT COUNT(*) FROM (SELECT v.id, v.title, v.owner, v.group, v.institution, 'view' AS urltype
FROM "view" v
JOIN "view_access" va ON va.view = v.id
LEFT JOIN "group" g ON g.id = v.group
LEFT JOIN "institution" i ON i.name = v.institution
WHERE va.accesstype IN ('public', 'loggedin')
AND v.type != 'profile'
AND (
)
AND (v.title ILIKE '%c%' OR g.name ILIKE '%c%' OR i.name ILIKE '%c%')
UNION
SELECT ii.id, ii.title, NULL AS owner, g.id AS group, g.institution, 'forum' AS urltype
FROM "interaction_
JOIN "group" g ON g.id = ii.group
WHERE g.public = 1
AND ii.deleted = 0
AND (ii.title ILIKE '%c%')
) AS foo OFFSET 0 LIMIT 10")Command was: SELECT COUNT(*) FROM (SELECT v.id, v.title, v.owner, v.group, v.institution, 'view' AS urltype
FROM "view" v
JOIN "view_access" va ON va.view = v.id
LEFT JOIN "group" g ON g.id = v.group
LEFT JOIN "institution" i ON i.name = v.institution
WHERE va.accesstype IN ('public', 'loggedin')
AND v.type != 'profile'
AND (
)
AND (v.title ILIKE ? OR g.name ILIKE ? OR i.name ILIKE ?)
UNION
SELECT ii.id, ii.title, NULL AS owner, g.id AS group, g.institution, 'forum' AS urltype
FROM "interaction_
JOIN "group" g ON g.id = ii.group
WHERE g.public = 1
AND ii.deleted = 0
AND (ii.title ILIKE ?)
) AS foo OFFSET ? LIMIT ? and values was (0:%c%,
Changed in mahara: | |
status: | New → Confirmed |
importance: | Undecided → High |
milestone: | none → 18.10rc2 |
summary: |
- 18.10 RC2: Custom landing page search broken in MySQL + Custom landing page search broken in MySQL |
Changed in mahara: | |
assignee: | nobody → Cecilia Vela Gurovic (ceciliavg) |
status: | Confirmed → In Progress |
Changed in mahara: | |
milestone: | 18.10rc2 → 18.10.0 |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Patch for "master" branch: https:/ /reviews. mahara. org/9216