Page 1 of 1

Phocadownload token and sh404sef

Posted: 20 Apr 2015, 21:20
by parsifaltheking
Hi, i've installed phocadownload 3.0.6 on joomla 3.4.1 and sh404sef.
So the component work but i've a problem when i wanto to use Token to download a file. I've enabled it in the option and create the token in the file.
The link that the system create is in this form:

http://www.xxx.it/component/phocadownlo ... 6c8d991c41

but if i insert it in a new browser page the link is changed in:

http://www.xxx.it/it/component/phocadow ... 6c8d991c41

where xxx is my site.

So i think that the sh404sef component changed it, so i've setting in the option that phocadownload skyp the rewrite but anything change.. so what i can do to use token with this component?

Thanks..

Re: Phocadownload token and sh404sef

Posted: 22 Apr 2015, 00:45
by Jan
Hi, when you disable the SEF component and enable the standard core Joomla! SEF, do you get the same problem?

Re: Phocadownload token and sh404sef

Posted: 22 Apr 2015, 20:29
by parsifaltheking
I've disable url rewrite on joomla and sh404sef component and the link generated works.. so i think it's a sh404sef component problem. i've open a support ticket.



Thanks

Re: Phocadownload token and sh404sef

Posted: 26 Apr 2015, 21:37
by Jan
Ok

Re: Phocadownload token and sh404sef

Posted: 27 Apr 2015, 15:35
by parsifaltheking
Hi, we have investigated with sh404sef team the problem for the token link and there is a problem.
In the site with sh404sef enabled and global configuration -> URl Sef enabled YES and Rewrite Url Sef - Yes phoca generate a wrong link in backend with token:

http://www.xxx.it/component/phocadownlo ... 64019a3b73
but goes mi a 404 error.

But if i use a non sef url with 404sef enable i obtain this link and it works:

http://www.xxx.it/it/?option=com_phocad ... 36c359f4b9

So there is a way to creati working link at file with sh404sef enabled?

Thanks

Re: Phocadownload token and sh404sef

Posted: 27 Apr 2015, 23:08
by Jan
Hi, unfortunately I don't know sh404sef, the link is created the following way:

- if there is no menu link to Phoca Download, the SEF link will not work
- if there is one, Phoca Download asks Joomla! to create SEF link (by JRoute method)

So now the question is if sh404sef uses the standard SEF methods or not, if not then the creation of the link needs to be customized directly in the code :idea:

Jan

Re: Phocadownload token and sh404sef

Posted: 27 Apr 2015, 23:11
by parsifaltheking
Hi, this is the reply from sh404sef team:

The root of the problem is that Joomla API doesn't provide any way of getting the front-end SEF URL of a page while you are in the backend. So developers have to find tricks to do it, and sometimes those tricks while OK with Joomla SEF only may not be ok Joomla+sh404SEF.

sh404SEF does provide an API to get the frontend SEF URL from the backend, which works for components that uses sh404SEF routing.
The code to use is:

$nonSef = ''index.php?option=com_content&Itemid=272&format=feed&id=14&lang=en&type=rss&view=category'';
if (!defined('SH404SEF_IS_RUNNING'))
{
$sef = Sh404sefHelperGeneral::getSefFromNonSef( $nonSef);
}

Re: Phocadownload token and sh404sef

Posted: 27 Apr 2015, 23:52
by Jan
Ok, so does it work for you, when you customize it?

Jan

Re: Phocadownload token and sh404sef

Posted: 28 Apr 2015, 12:19
by parsifaltheking
Hi, this is The code that The team send to me But i dont have idea where or how insert it in The component

Re: Phocadownload token and sh404sef

Posted: 30 Apr 2015, 00:06
by Jan
Hi, see:

administrator\components\com_phocadownload\views\phocadownloadfile\tmpl\edit.php

cca line 81
if (isset($this->item->id) && isset($this->item->catid) && isset($this->item->token)
...
}