Page 1 of 1

Phoca Gallery Search Plugin + Universal Ajax Live Search

Posted: 13 Jan 2015, 19:38
by clogg
Hello Jan!

First of all, thank you very mych for all the brilliant work you do for Phoca projects.
Secondly, I would like to inform you, that I encountered problems with integration of Phoca Gallery Search Plugin + Universal Ajax Live Search (live search gave no results). I asked the suppoort of UALS for the solution and it occured, that the problem was inside Phoca Gallery Search Plugin.
Please find below changed lines. The changes caused the Search plugin to work (Joomla! 3.3.6 Stable, php 5.5). Not sure if the changes make sens from Phoca product point of view, bu they work on my side. Maybe you would be interesting in checking on that:

file /plugins/search/phocagallery.php

Line 98:
old:
$text = $db->Quote('%'.$db->getEscaped($text, true).'%', false);

new:
$text = $db->Quote('%'.$db->escape($text, true).'%', false);

Line 116:
old:
$word = $db->Quote('%'.$db->getEscaped($word, true).'%', false);
new:
$word = $db->Quote('%'.$db->escape($word, true).'%', false);

Line: 167
old:
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $value->accessuserid, $value->access, $user->authorisedLevels(), $user->get('id', 0), $display_access_category);
new:
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $value->accessuserid, $value->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), $display_access_category);


Line: 223
old:
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $value->accessuserid, $value->cataccess, $user->authorisedLevels(), $user->get('id', 0), $display_access_category);
new:
$rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $value->accessuserid, $value->cataccess, $user->getAuthorisedViewLevels(), $user->get('id', 0), $display_access_category);


However I still have problem with finishing indexation of native SmartSearch (indexation freezes at some point). The problem no longer exists when I disablw PhocaGalleryPlugin

This is just for your information. I am not expecting your assistance with the mentioned problems (I am already very happy with the products you create) - I am just trying to help a bit with solving some problems. Moreover, I can give you admin access to my website so that you are able to check the issue on your own, without a need to configure test enfironment. Please let me know if you are interested and if so, please provide me with an information about how to send you all credentials in a secure way.

Kind Regards
Clogg

Re: Phoca Gallery Search Plugin + Universal Ajax Live Search

Posted: 15 Jan 2015, 00:23
by Jan
Hi.

Which plugin did you use, because yes it is right, there are new methods like you have described (escape, getAuthorisedViewLevels).

"I was stopped" many times while debugging Smartsearch, because it all works in AJAX, it is hard to find the problems.

Did you try to test it with Firebug and javascript console, this should display errors which cause the freezing of indexing :idea:

Jan