Page 1 of 2

Phoca Download Search Plugin Bug

Posted: 20 Nov 2018, 02:25
by nunoleite
Hi!

I think i found a bug on the Phoca Download search Plugin.
When doing a search and then change the Order to... for example Category, the search returns an error:
1054
Unknown column 'c.title' in 'order clause'

This only happens with the plugin enabled.

Thanks
Nuno Leite

Re: Phoca Download Search Plugin Bug

Posted: 21 Nov 2018, 11:35
by Jan
Hi,

which version of Phoca Download component and Phoca Download plugin do you use? Can you paste the whole error message (when you enable debug mode on your server)?

Jan

Re: Phoca Download Search Plugin Bug

Posted: 21 Nov 2018, 19:04
by nunoleite
Hi!
I'm using Phoca Download 3.1.4 and Search plugin 3.1.0
I have enabled debug mode, but when the page turns to error there is no debug information at the end of the page.
I send you the link that turns the error so you can test:
[link deleted]
You can try this link with any website has it will throw the error.

Thanks
Nuno Leite

Re: Phoca Download Search Plugin Bug

Posted: 29 Nov 2018, 13:03
by nunoleite
Hi!
I don't know if you saw the link, has it was deleted.
I'm putting here part of the link: ?searchword=teste&ordering=category&searchphrase=all&limit=30
This kind of search with the Phoca Download Search Plugin enabled returns that error.

Thanks
Nuno Leite

Re: Phoca Download Search Plugin Bug

Posted: 01 Dec 2018, 17:59
by Jan
Hi, when you enable debug mode, you should get the error:
1054 Unknown column 'c.title' in 'order clause'

explained with whole error message including the files where this occurs, can you paste a screenshot of the error? (Error message + whole SQL query + all the files loaded before the error - such page you should get with enabled debug mode.)

Jan

Re: Phoca Download Search Plugin Bug

Posted: 03 Dec 2018, 23:06
by nunoleite
Hi!

I had to disable error.php from the template has it was clearing the debug information on the error page.
Here it is.
Image

Code: Select all

1054 - Unknown column 'c.title' in 'order clause'

Poderá não conseguir aceder a esta página devido a:

    um marcador web estará desatualizado
    um motor de pesquisa com um registo desatualizado sobre este sítio
    um erro ao escrever o endereço
    Não possui permissões de acesso a esta página
    O recurso solicitado não foi encontrado.
    Ocorreu um erro ao processar o seu pedido.

Por favor tente uma das seguintes páginas:

    Entrada

Se as dificuldades continuarem, por favor, contacte um administrador do sítio e reporte-lhe este erro.

Unknown column 'c.title' in 'order clause'
/home/jfalcochete/public_html/libraries/joomla/database/driver/mysqli.php:661
Call stack
# 	Function 	Location
1 	() 	JROOT/libraries/joomla/database/driver/mysqli.php:661
2 	JDatabaseDriverMysqli->execute() 	JROOT/libraries/joomla/database/driver.php:1691
3 	JDatabaseDriver->loadObjectList() 	JROOT/plugins/search/phocadownload/phocadownload.php:159
4 	plgSearchPhocaDownload->onContentSearch() 	JROOT/libraries/joomla/event/event.php:70
5 	JEvent->update() 	JROOT/libraries/joomla/event/dispatcher.php:160
6 	JEventDispatcher->trigger() 	JROOT/libraries/regularlabs/helpers/search.php:161
7 	SearchModelSearch->getData() 	JROOT/libraries/src/MVC/View/HtmlView.php:423
8 	Joomla\CMS\MVC\View\HtmlView->get() 	JROOT/components/com_search/views/search/view.html.php:126
9 	SearchViewSearch->display() 	JROOT/libraries/src/MVC/Controller/BaseController.php:672
10 	Joomla\CMS\MVC\Controller\BaseController->display() 	JROOT/components/com_search/controller.php:34
11 	SearchController->display() 	JROOT/libraries/src/MVC/Controller/BaseController.php:710
12 	Joomla\CMS\MVC\Controller\BaseController->execute() 	JROOT/components/com_search/search.php:13
13 	require_once() 	JROOT/libraries/src/Component/ComponentHelper.php:382
14 	Joomla\CMS\Component\ComponentHelper::executeComponent() 	JROOT/libraries/src/Component/ComponentHelper.php:357
15 	Joomla\CMS\Component\ComponentHelper::renderComponent() 	JROOT/libraries/src/Application/SiteApplication.php:194
16 	Joomla\CMS\Application\SiteApplication->dispatch() 	JROOT/libraries/src/Application/SiteApplication.php:233
17 	Joomla\CMS\Application\SiteApplication->doExecute() 	JROOT/libraries/src/Application/CMSApplication.php:195
18 	Joomla\CMS\Application\CMSApplication->execute() 	JROOT/index.php:49 
Thanks
Nuno Leite

Re: Phoca Download Search Plugin Bug

Posted: 08 Dec 2018, 14:51
by Jan
Hi, in the debug, you should see the whole SQL query (isn't there displayed?)

Image

When you open this file:
plugins\search\phocadownload\phocadownload.php

and edit it on line cca. 84

FROM:

Code: Select all

			case 'category':
				$order = 'c.title ASC, a.title ASC';
				break;


TO:

Code: Select all

				case 'category':
				$order = 'a.title ASC';
				break; 


does something change?

Jan

Re: Phoca Download Search Plugin Bug

Posted: 12 Dec 2018, 18:49
by nunoleite
Hi!

No, that "Joomla! Debaug console" is not showing.

I have changed that line and it solves the problem but does it do the order correctly? choosing the category? Because it will order by the article title.
It will work as the alpha:

Code: Select all

			case 'alpha':
				$order = 'a.title ASC';
				break;
When i choose oldest it throws the same error but with "Unknown column 'a.created' in 'order clause'"
Maybe this would be:

Code: Select all

			case 'oldest':
				$order = 'a.date ASC';
				break;
Thanks
Nuno Leite

Re: Phoca Download Search Plugin Bug

Posted: 12 Dec 2018, 19:02
by Jan
Hmmm, really hard to say, testing now without any such problem :idea: :-(

Jan

Re: Phoca Download Search Plugin Bug

Posted: 20 Jan 2019, 01:06
by Jan
Hi, should be Ok in version 3.1.5

Jan