Search on "Pages and collections" doesn't work for collections

Bug #1681629 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Cecilia Vela Gurovic
17.04
Fix Released
High
Cecilia Vela Gurovic
17.10
Fix Released
High
Unassigned

Bug Description

Mahara master / 17.04RC1

When you try to search for a collection, the following error message is returned:

[WAR] cf (lib/errors.php:859) Failed to get a recordset: postgres8 error: [-2: ERROR: syntax error at or near ")"
LINE 1: SELECT * FROM "view_tag" WHERE view IN ()
                                                ^] in EXECUTE("SELECT * FROM "view_tag" WHERE view IN () ")Command was: SELECT * FROM "view_tag" WHERE view IN ()
Call stack (most recent first):

    log_message("Failed to get a recordset: postgres8 error: [-2: E...", 8, true, true) at /home/kristina/code/mahara/htdocs/lib/errors.php:95
    log_warn("Failed to get a recordset: postgres8 error: [-2: E...") at /home/kristina/code/mahara/htdocs/lib/errors.php:859
    SQLException->__construct("Failed to get a recordset: postgres8 error: [-2: E...") at /home/kristina/code/mahara/htdocs/lib/dml.php:517
    get_recordset_sql("SELECT * FROM "view_tag" WHERE view IN () ", false) at /home/kristina/code/mahara/htdocs/lib/dml.php:466
    get_recordset_select("view_tag", " WHERE view IN ()", null, "", "*", "", "") at /home/kristina/code/mahara/htdocs/lib/dml.php:666
    get_records_select_array("view_tag", "view IN ()") at /home/kristina/code/mahara/htdocs/lib/view.php:5377
    View::get_extra_view_info(array(size 1), false) at /home/kristina/code/mahara/htdocs/lib/view.php:3801
    View::get_myviews_data(12, 0, "asdfasdf", null, null, "titleanddescriptionandtags", "latestviewed") at /home/kristina/code/mahara/htdocs/lib/view.php:4025
    View::views_by_owner() at /home/kristina/code/mahara/htdocs/view/index.php:25

[WAR] cf (lib/dml.php:517) Failed to get a recordset: postgres8 error: [-2: ERROR: syntax error at or near ")"
LINE 1: SELECT * FROM "view_tag" WHERE view IN ()
                                                ^] in EXECUTE("SELECT * FROM "view_tag" WHERE view IN () ")Command was: SELECT * FROM "view_tag" WHERE view IN ()
Call stack (most recent first):

    get_recordset_sql("SELECT * FROM "view_tag" WHERE view IN () ", false) at /home/kristina/code/mahara/htdocs/lib/dml.php:466
    get_recordset_select("view_tag", " WHERE view IN ()", null, "", "*", "", "") at /home/kristina/code/mahara/htdocs/lib/dml.php:666
    get_records_select_array("view_tag", "view IN ()") at /home/kristina/code/mahara/htdocs/lib/view.php:5377
    View::get_extra_view_info(array(size 1), false) at /home/kristina/code/mahara/htdocs/lib/view.php:3801
    View::get_myviews_data(12, 0, "asdfasdf", null, null, "titleanddescriptionandtags", "latestviewed") at /home/kristina/code/mahara/htdocs/lib/view.php:4025
    View::views_by_owner() at /home/kristina/code/mahara/htdocs/view/index.php:25

To replicate:

1. Set up a collection "Collection" with the tags "collectiontag" and "tag".
2. Set up a page "Page" with the tag "pagetag" and "tag".
3. Search within "Title, description" / "Title, description, tags" for "collection", "collectiontag" and "tag"

You get an error message. Expected result: It finds your page and / or collection.

Additionally, if you select to search within "Tags" but don't provide a search term, all results should be displayed.

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/7625

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

Reviewed: https://reviews.mahara.org/7625
Committed: https://git.mahara.org/mahara/mahara/commit/814b9f7ffde302403a1f4a5a50805ddfbddf0bf8
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 814b9f7ffde302403a1f4a5a50805ddfbddf0bf8
Author: Cecilia Vela Gurovic <email address hidden>
Date: Wed Apr 12 11:01:53 2017 +1200

Bug 1681629: Fix error when searching for tagged collections

Change-Id: I0e0f5de1d28047d1926f4b944a41768fb8dd73ae
behatnotneeded: no new functionality

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

Patch for "17.04_STABLE" branch: https://reviews.mahara.org/7635

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

Reviewed: https://reviews.mahara.org/7635
Committed: https://git.mahara.org/mahara/mahara/commit/547ee20150d0e416d80d910a32a1e9e401afccce
Submitter: Robert Lyon (<email address hidden>)
Branch: 17.04_STABLE

commit 547ee20150d0e416d80d910a32a1e9e401afccce
Author: Cecilia Vela Gurovic <email address hidden>
Date: Wed Apr 12 11:01:53 2017 +1200

Bug 1681629: Fix error when searching for tagged collections

Change-Id: I0e0f5de1d28047d1926f4b944a41768fb8dd73ae
behatnotneeded: no new functionality
(cherry picked from commit 814b9f7ffde302403a1f4a5a50805ddfbddf0bf8)

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.