** Changed in: mahara
     Assignee: (unassigned) => Cecilia Vela Gurovic (ceciliavg)

** Changed in: mahara
       Status: Confirmed => In Progress

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask 
on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1797299

Title:
  Custom landing page search broken in MySQL

Status in Mahara:
  In Progress

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 (
                  (v.owner IS NULL AND v.template != 2)
                    OR
                  (v.owner IN ('1'))
              )
              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_instance" ii
              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 (
                  (v.owner IS NULL AND v.template != 2)
                    OR
                  (v.owner IN ('1'))
              )
              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_instance" ii
              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%,1:%c%,2:%c%,3:%c%,4:0,5:10)

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1797299/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to