Forums | Mahara Community

Support /
Searching for shared page brings up errors


Kristina Hoeppner's profile picture
Posts: 4866

17 October 2016, 8:04

sent via email:

Hey,

Now the version of our Mahara is 15.10.XXX. When search a page people shared with me, the problem will occur.

Do you have any idea to fix it.

Thanks.

Below is the error:

[WAR] 3c (lib/errors.php:747) Failed to get a recordset: mysqli error: [1054: Unknown column 'cv.collection' in 'on clause'] in EXECUTE("SELECT COUNT(*) 
            FROM "view" v
            LEFT OUTER JOIN "collection_view" cv ON cv.view = v.id
            LEFT OUTER JOIN "collection" c ON cv.collection = c.id
            LEFT OUTER JOIN "usr" qu ON (v.owner = qu.id)
            
                LEFT JOIN "view_tag" vt ON (vt.view = v.id AND vt.tag = 'text')
                LEFT OUTER JOIN "group" qqg ON (v.group = qqg.id)
                LEFT OUTER JOIN "institution" qqi ON (v.institution = qqi.name)LEFT OUTER JOIN (
                SELECT c.onview, MAX(a.mtime) AS lastcomment
                FROM "artefact_comment_comment" c JOIN "artefact" a ON c.artefact = a.id AND c.deletedby IS NULL AND c.private = 0
                GROUP BY c.onview
            ) l ON v.id = l.onview
            WHERE ((v.owner IS NULL OR v.owner > 0) AND v.owner != '1')
                AND (v.group IS NULL OR v.group NOT IN (SELECT id FROM "group" WHERE deleted = 1))
                AND (qu.suspendedctime is null OR v.owner = '1') AND v.type IN ('portfolio')
                AND (v.title LIKE '%' || 'text' || '%'
                    OR v.description LIKE '%' || 'text' || '%'
                    OR vt.tag = 'text'
                    OR qu.preferredname LIKE '%' || 'text' || '%'
                    OR qu.firstname LIKE '%' || 'text' || '%'
                    OR qu.lastname LIKE '%' || 'text' || '%'
                    OR qqg.name LIKE '%' || 'text' || '%'
                    OR qqi.displayname LIKE '%' || 'text' || '%'
                    
                    
                    OR qu.username LIKE '%' || 'text' || '%' OR EXISTS (
                    SELECT 1
                    FROM
                        "view" v2
                        INNER JOIN "collection_view" cv2
                            ON v2.id=cv2.view
                            AND cv2.collection = cv.collection
                        INNER JOIN "collection" c2
                            ON c2.id = cv2.collection
                        LEFT OUTER JOIN "view_tag" vt
                            ON (vt.view = v2.id AND vt.tag = 'text')
                        LEFT OUTER JOIN "collection_tag" ct
                            ON (ct.collection = cv2.collection AND ct.tag = 'text')
                    WHERE
                        v2.title LIKE '%' || 'text' || '%'
                        OR v2.description LIKE '%' || 'text' || '%'
                        OR c2.name LIKE '%' || 'text' || '%'
                        OR c2.description LIKE '%' || 'text' || '%'
                        OR vt.tag = 'text'
                        OR ct.tag = 'text'
                ))
                AND (cv.displayorder = 0 OR cv.displayorder IS NULL)
            
                AND (FALSE
                    OR ( -- user has permission to see the view
                        (v.startdate IS NULL OR v.startdate < current_timestamp)
                        AND (v.stopdate IS NULL OR v.stopdate > current_timestamp)
                        AND (v.id IN (-- user access
                                SELECT va.view
                                FROM "view_access" va
                                WHERE va.usr = '1'
                                    AND (va.startdate IS NULL OR va.startdate < current_timestamp)
                                    AND (va.stopdate IS NULL OR va.stopdate > current_timestamp)
                            UNION -- friend access
                                SELECT va.view
                                FROM "view_access" va
                                    JOIN "view" vf ON va.view = vf.id AND vf.owner IS NOT NULL
                                    JOIN "usr_friend" f ON ((f.usr1 = '1' AND f.usr2 = vf.owner) OR (f.usr1 = vf.owner AND f.usr2 = '1'))
                                WHERE va.accesstype = 'friends'
                                    AND (va.startdate IS NULL OR va.startdate < current_timestamp)
                                    AND (va.stopdate IS NULL OR va.stopdate > current_timestamp)
                            UNION -- group access
                                SELECT va.view
                                FROM "view_access" va
                                    JOIN "group_member" m ON va.group = m.group AND (va.role = m.role OR va.role IS NULL)
                                WHERE
                                    m.member = '1'
                                    AND (va.startdate IS NULL OR va.startdate < current_timestamp)
                                    AND (va.stopdate IS NULL OR va.stopdate > current_timestamp)
                            ))))")
Command was: SELECT COUNT(*) 
            FROM "view" v
            LEFT OUTER JOIN "collection_view" cv ON cv.view = v.id
            LEFT OUTER JOIN "collection" c ON cv.collection = c.id
            LEFT OUTER JOIN "usr" qu ON (v.owner = qu.id)
            
                LEFT JOIN "view_tag" vt ON (vt.view = v.id AND vt.tag = ?)
                LEFT OUTER JOIN "group" qqg ON (v.group = qqg.id)
                LEFT OUTER JOIN "institution" qqi ON (v.institution = qqi.name)LEFT OUTER JOIN (
                SELECT c.onview, MAX(a.mtime) AS lastcomment
                FROM "artefact_comment_comment" c JOIN "artefact" a ON c.artefact = a.id AND c.deletedby IS NULL AND c.private = 0
                GROUP BY c.onview
            ) l ON v.id = l.onview
            WHERE ((v.owner IS NULL OR v.owner > 0) AND v.owner != ?)
                AND (v.group IS NULL OR v.group NOT IN (SELECT id FROM "group" WHERE deleted = 1))
                AND (qu.suspendedctime is null OR v.owner = ?) AND v.type IN ('portfolio')
                AND (v.title LIKE '%' || ? || '%'
                    OR v.description LIKE '%' || ? || '%'
                    OR vt.tag = ?
                    OR qu.preferredname LIKE '%' || ? || '%'
                    OR qu.firstname LIKE '%' || ? || '%'
                    OR qu.lastname LIKE '%' || ? || '%'
                    OR qqg.name LIKE '%' || ? || '%'
                    OR qqi.displayname LIKE '%' || ? || '%'
                    
                    
                    OR qu.username LIKE '%' || ? || '%' OR EXISTS (
                    SELECT 1
                    FROM
                        "view" v2
                        INNER JOIN "collection_view" cv2
                            ON v2.id=cv2.view
                            AND cv2.collection = cv.collection
                        INNER JOIN "collection" c2
                            ON c2.id = cv2.collection
                        LEFT OUTER JOIN "view_tag" vt
                            ON (vt.view = v2.id AND vt.tag = ?)
                        LEFT OUTER JOIN "collection_tag" ct
                            ON (ct.collection = cv2.collection AND ct.tag = ?)
                    WHERE
                        v2.title LIKE '%' || ? || '%'
                        OR v2.description LIKE '%' || ? || '%'
                        OR c2.name LIKE '%' || ? || '%'
                        OR c2.description LIKE '%' || ? || '%'
                        OR vt.tag = ?
                        OR ct.tag = ?
                ))
                AND (cv.displayorder = 0 OR cv.displayorder IS NULL)
            
                AND (FALSE
                    OR ( -- user has permission to see the view
                        (v.startdate IS NULL OR v.startdate < current_timestamp)
                        AND (v.stopdate IS NULL OR v.stopdate > current_timestamp)
                        AND (v.id IN (-- user access
                                SELECT va.view
                                FROM "view_access" va
                                WHERE va.usr = ?
                                    AND (va.startdate IS NULL OR va.startdate < current_timestamp)
                                    AND (va.stopdate IS NULL OR va.stopdate > current_timestamp)
                            UNION -- friend access
                                SELECT va.view
                                FROM "view_access" va
                                    JOIN "view" vf ON va.view = vf.id AND vf.owner IS NOT NULL
                                    JOIN "usr_friend" f ON ((f.usr1 = ? AND f.usr2 = vf.owner) OR (f.usr1 = vf.owner AND f.usr2 = ?))
                                WHERE va.accesstype = 'friends'
                                    AND (va.startdate IS NULL OR va.startdate < current_timestamp)
                                    AND (va.stopdate IS NULL OR va.stopdate > current_timestamp)
                            UNION -- group access
                                SELECT va.view
                                FROM "view_access" va
                                    JOIN "group_member" m ON va.group = m.group AND (va.role = m.role OR va.role IS NULL)
                                WHERE
                                    m.member = ?
                                    AND (va.startdate IS NULL OR va.startdate < current_timestamp)
                                    AND (va.stopdate IS NULL OR va.stopdate > current_timestamp)
                            )))) and values was (text,1,1,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text,1,1,1,1)
Call stack (most recent first):
log_message("Failed to get a recordset: mysqli error: [1054: Un...", 8, true, true) at /var/www/mahara/htdocs/lib/errors.php:97
log_warn("Failed to get a recordset: mysqli error: [1054: Un...") at /var/www/mahara/htdocs/lib/errors.php:747
SQLException->__construct("Failed to get a recordset: mysqli error: [1054: Un...") at /var/www/mahara/htdocs/lib/dml.php:513
get_recordset_sql("SELECT COUNT(*) FROM {view} v ...", array(size 24)) at /var/www/mahara/htdocs/lib/dml.php:276
count_records_sql("SELECT COUNT(*) FROM {view} v ...", array(size 24)) at /var/www/mahara/htdocs/lib/view.php:4290
View::view_search("text", null, null, null, 10, 0, true, array(size 1), array(size 1), false, array(size 3), null, null, "1", true) at /var/www/mahara/htdocs/lib/view.php:4420
View::shared_to_user("text", null, 10, 0, "lastchanged", "desc", array(size 3), "1") at /var/www/mahara/htdocs/view/sharedviews.php:151

Regards,

Jungle CHEN

Kristina Hoeppner's profile picture
Posts: 4866

17 October 2016, 8:06

Hello Jungle,

Can you please update to the latest version of Mahara 15.10? If that doesn't resolve your error, please provide the steps for replication. Where do you search for a page?

Thank you

Kristina

 

Jungle Chen's profile picture
Posts: 3

17 October 2016, 18:22

Thanks.  

Overwrite  lib/view.php of  version 15.10.1with lib/view.php of version 15.10.3 . and then that problem solved.

Kristina Hoeppner's profile picture
Posts: 4866

17 October 2016, 22:27

Great that you could solve the problem, Jungle, by updating to a later version.

Cheers

Kristina

 

4 results