Phoca Download Search Plugin Bug

Phoca Download - download manager
nunoleite
Phoca Member
Phoca Member
Posts: 38
Joined: 15 Apr 2018, 01:00

Phoca Download Search Plugin Bug

Post 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

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Download Search Plugin Bug

Post 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
If you find Phoca extensions useful, please support the project
nunoleite
Phoca Member
Phoca Member
Posts: 38
Joined: 15 Apr 2018, 01:00

Re: Phoca Download Search Plugin Bug

Post 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
Last edited by christine on 21 Nov 2018, 19:35, edited 1 time in total.
Reason: link deleted - as unserious one
nunoleite
Phoca Member
Phoca Member
Posts: 38
Joined: 15 Apr 2018, 01:00

Re: Phoca Download Search Plugin Bug

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Download Search Plugin Bug

Post 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
If you find Phoca extensions useful, please support the project
nunoleite
Phoca Member
Phoca Member
Posts: 38
Joined: 15 Apr 2018, 01:00

Re: Phoca Download Search Plugin Bug

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Download Search Plugin Bug

Post 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
If you find Phoca extensions useful, please support the project
nunoleite
Phoca Member
Phoca Member
Posts: 38
Joined: 15 Apr 2018, 01:00

Re: Phoca Download Search Plugin Bug

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Download Search Plugin Bug

Post by Jan »

Hmmm, really hard to say, testing now without any such problem :idea: :-(

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48402
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Phoca Download Search Plugin Bug

Post by Jan »

Hi, should be Ok in version 3.1.5

Jan
If you find Phoca extensions useful, please support the project
Post Reply