Error Message Help

Permalink 2 users found helpful
Hi, I am using a block called "document Library" with a search function. When I try to search for a document I get the following error.

An unexpected error occurred.
An exception occurred while executing 'SELECT distinct n.treeNodeID, if(nt.treeNodeTypeHandle='file', fv.fvTitle, n.treeNodeName) as folderItemName, if(nt.treeNodeTypeHandle='file', fv.fvDateAdded, n.dateModified) as folderItemModified, case when nt.treeNodeTypeHandle='search_preset' then 1 when nt.treeNodeTypeHandle='file_folder' then 2 else (10 + fvType) end as folderItemType, fv.fvSize as folderItemSize, ak_Text FROM TreeNodes n INNER JOIN TreeNodeTypes nt ON nt.treeNodeTypeID = n.treeNodeTypeID LEFT JOIN TreeFileNodes tf ON tf.treeNodeID = n.treeNodeID LEFT JOIN FileVersions fv ON tf.fID = fv.fID and fv.fvIsApproved = 1 LEFT JOIN FileSearchIndexAttributes fis ON fv.fID = fis.fID WHERE ((fv.fvFilename LIKE ?) OR (fv.fvDescription LIKE ?) OR (fv.fvTitle LIKE ?) OR (fv.fvTags LIKE ?) OR (fv.fvTags LIKE ?) OR (n.treeNodeName LIKE ?) OR (ak_image_tag LIKE ?) OR (ak_gallery_columns LIKE ?) OR (ak_internal_link_cid LIKE ?) OR (ak_external_link_url LIKE ?) OR (ak_link_type LIKE ?) OR (ak_image_link LIKE ?) OR (ak_image_link_text LIKE ?) OR (ak_image_thumbnail_width LIKE ?)) AND (n.treeNodeParentID IN ('1923', '1972', '1973', '1974', '1975', '1976', '1978', '1979', '1980', '2801')) ORDER BY ak_Text asc LIMIT 20 OFFSET 0' with params ["%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%", "%August 2018%"]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ak_internal_link_cid' in 'where clause'

Has anybody got any idea what is wrong please?

 
hutman replied on at Permalink Reply
hutman
Does your site have an attribute with the handle "internal_link_cid"? The query doesn't seem to be able to find it.
swinn replied on at Permalink Reply
As far as I know we haven't. Basically, we put the document library block on a page of our web site, pointed it at a few folders with files in and it produced a list on the page as we expected , but when we used the built in search facility to search for a particular file we got that error.
hutman replied on at Permalink Reply
hutman
If you go to Dashboard -> Files -> Attributes you should be able to see for sure. If it doesn't exist there, I would create it. If it does exist there check the box for "Content included in search index." and then go to Dashboard -> System & Settings -> Automated Jobs and run the "Index Search Engine - All" job.
swinn replied on at Permalink Reply
Thanks again for that. It does exist and the box is checked so I am running the index and see what happens.
swinn replied on at Permalink Reply
Hi, I have followed your instructions and I am still getting an error …
hutman replied on at Permalink Reply
hutman
What is the error?
swinn replied on at Permalink Reply
The error is:

An exception occurred while executing 'SELECT distinct n.treeNodeID, if(nt.treeNodeTypeHandle='file', fv.fvTitle, n.treeNodeName) as folderItemName, if(nt.treeNodeTypeHandle='file', fv.fvDateAdded, n.dateModified) as folderItemModified, case when nt.treeNodeTypeHandle='search_preset' then 1 when nt.treeNodeTypeHandle='file_folder' then 2 else (10 + fvType) end as folderItemType, fv.fvSize as folderItemSize FROM TreeNodes n INNER JOIN TreeNodeTypes nt ON nt.treeNodeTypeID = n.treeNodeTypeID LEFT JOIN TreeFileNodes tf ON tf.treeNodeID = n.treeNodeID LEFT JOIN FileVersions fv ON tf.fID = fv.fID and fv.fvIsApproved = 1 LEFT JOIN FileSearchIndexAttributes fis ON fv.fID = fis.fID WHERE ((fv.fvFilename LIKE ?) OR (fv.fvDescription LIKE ?) OR (fv.fvTitle LIKE ?) OR (fv.fvTags LIKE ?) OR (fv.fvTags LIKE ?) OR (n.treeNodeName LIKE ?) OR (ak_image_tag LIKE ?) OR (ak_gallery_columns LIKE ?) OR (ak_internal_link_cid LIKE ?) OR (ak_external_link_url LIKE ?) OR (ak_link_type LIKE ?) OR (ak_image_link LIKE ?) OR (ak_image_link_text LIKE ?) OR (ak_image_thumbnail_width LIKE ?)) AND (n.treeNodeParentID IN ('1870')) ORDER BY fv.fvTitle asc LIMIT 20 OFFSET 0' with params ["%Abide%", "%Abide%", "%Abide%", "%Abide%", "%Abide%", "%Abide%", "%Abide%", "%Abide%", "%Abide%", "%Abide%", "%Abide%", "%Abide%", "%Abide%", "%Abide%"]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ak_internal_link_cid' in 'where clause'
brutalnv replied on at Permalink Reply
brutalnv
I faced the same issue right today. Looks like it is related to the
https://www.concrete5.org/marketplace/addons/easy-image-gallery... addon.

Here is my solution:

1) Go to the Dashboard -> Files -> Attributes and find "Link to page" attribute (which has a handle internal_link_cid).

2) Disable "Content included in search index" and "Field available in advanced search" checkboxes then save an attribute.

3) Go to the Dashboard -> System and settings -> Automated Jobs.
Perform "Index Search Engine - All".

That's all.
Hope it will help someone =)
swinn replied on at Permalink Reply
Thanks for that, it works ….one happy website again.
brutalnv replied on at Permalink Reply
brutalnv
Awesome!
drbiskit replied on at Permalink Reply
drbiskit
Amazing - Had the same problem and this fixed things - Thanks very much!

Out of interest - Just wondered if you reported this to the plugin dev at all?
brutalnv replied on at Permalink Reply
brutalnv
There is an open discussion regarding this issue on the Easy Image Gallery addon support page, but no reaction from the dev.

https://www.concrete5.org/marketplace/addons/easy-image-gallery/supp...
barkingtuna replied on at Permalink Reply
barkingtuna
Thank you for this... you just saved me from going down an endless rabbit hole!
ppisoban replied on at Permalink Reply
ppisoban
Thank you, you've saved what is left of my hair! :)
brutalnv replied on at Permalink Reply
brutalnv
You're welcome =)