jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => Bugs => Topic started by: smartgig on 05.04.2015 12:56:36

Title: pagination error after upgrading from j2.5 to j3.4
Post by: smartgig on 05.04.2015 12:56:36
Hello,

I had joomla 2.5 with jdownloads on my website, I upgraded it to joomla 3.3 (and recently 3.4) recently.
Now I found that the downloads which are created in joomla 2.5 aren't working, but those which are created in joomla 3 are working fine.
How can I address the issue?

Here is the link of an affected page:
URL Link

Description on the following page (check the middle of the description picture):
Description Link

I'm using  jDownloads Version 3.2.31 and Joomla! 3.4.1 on PHP/5.4.21 and MySQL 5.5.42
Thanks
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: ColinM on 06.04.2015 18:38:00
Hi
Before trying anything to correct the problem please make a site backup  - personally I use Akeeba.  Also please excuse all the questions as I am trying to understand the process you went through!

Which version of jDownloads were you using on Joomla! 2.5?  Was it jD2.5 series or jD1.9.1.x series?

When you say the old downloads are not working is it because it reports you do not have permission?  If it is permissions then please try the jDownloads backup/restore sequence as described in the article "http://www.jdownloads.net/documentations/item/permissions-problems-after-migration-to-new-series"  This is sometimes a problem with coming from the 1.9. series but it may also apply to the jd2.5 to jD3.2 series.

What sequence did you do with jDownloads when migrating from Joomla 2.5 to Joomla 3? 
Did you create any jDownloads categories/downloads in jD3.2 before restoring the old jD2.5 data?

Colin
PS do you still have the old Joomla 2.5 site?
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: smartgig on 06.04.2015 19:16:31
I followed the instructions mentioned here to upgrade my jdownloads file. My latest jdownloads version in joomla 2.5 was  1.9.2.11 Beta.

Here is the description of the problem:

The jdownload files which are created in joomla 3 and are working properly has the following format:
/index.php?option=com_jdownloads&view=download&id=<id>:<title-of-the-file-even-with-utf8-characters-(persian-in-this-case)>&catid=<catid>&Itemid=<itemid>

The jdownload files which are created in joomla 2.5 and currently doesn't work in joomla 2.5 (returns a 404 page) has the following format:
/index.php?option=com_jdownloads&view=download&id=<id>:<title-of-the-file-ONLY-english-characters-are-allowed-AND-utf8-characters-(persian-in-this-case)-are-dropped-NUMBERS-are-kept-IF-the-title-had-no-numbers-USE-creation-time-and-date-of-the-jdownload-entry>&catid=<catid>&Itemid=<itemid>

The problem only affects files with Persian name.
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: ColinM on 07.04.2015 01:45:53
Hi
We might have two things happening here.  First I understand that you we running jD 1.9.2.11 beta on Joomla 2.5 and that the Downloads there did not work on Joomla 2.5.  Further those Downloads are also not working on jD3.3 on Joomla 3.x

Now jD 1.9.2 series was designed to run on Joomla 3.x not Joomla 2.5.x  It was jD 1.9.1.x that runs on Joomla 2.5. So it may be that the old "Joomla 2.5 Downloads" are not properly recoverable.

But I think you said it is only the ones with Persian ttitles that have the problem. Are there many of them?

When you say they do not work are there any error messages or dothey just not start downloading?

Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: smartgig on 07.04.2015 06:45:47
Hello ColinM

Thank you for your reply.

jD files were working fine on joomla 2.5 and we had no problem there.
The problem only applies to files with persian title and almost all files have a persian title.

The problem here is that jD on joomla 3 expects the persian title to be present in the URL whereas jD on joomla 2.5 doesn't expect any persian character in the url.
It simply returns a 404 joomla page not found error and it's not possible to view file description page of the affected jD entry which contains download link.
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: ColinM on 07.04.2015 22:02:01
Hi
Still searching for clues!  I think I understand the symptoms.  Visited the page you suggested.  All except the last one downloaded OK.  The last one gave a 404 error as you said.  See pic pagination01.png

From my test site with Joomla! System settings, Global Config - Site tab: Search Engine Friendly URLs as Yes and Use URL Rewriting as Yes then the link was of the form
<a href="/j32/list-subcata1/download/23-subcata3/97-downloada3-1">downloadA3-1</a>  The part displayed twice, namely "downloada3-1", is the Download title, not the file name.

Changed Global Config - Site tab: Search Engine Friendly URLs as No and Use URL Rewriting as No then the link was of the form
<a href="/j32/index.php?option=com_jdownloads&amp;view=download&amp;id=97:downloada3-1&amp;catid=23&amp;Itemid=1247">downloadA3-1</a>

Can you confirm that you have Search Engine Friendly URLs as No and Use URL Rewriting as No?

Topic http://www.jdownloads.com/forum/index.php?topic=8049.msg32194#msg32194
Page accessed in site is from
<a href="http://www.sibtayn.com/fa/index.php?option=com_jdownloads&amp;view=category&amp;catid=10&amp;Itemid=2596" target="_blank">URL Link</a>

All the following were by clicking on Download Title, not the download 'button'  In all cases except the bad one it went to the download details page.

Good one, 2nd from bottom, has generated code as:
<a href="/fa/index.php?option=com_jdownloads&amp;view=download&amp;id=3430:سيد-مهدی-ميرداماد-كليپ-بی-تو-زهرا-عليها-السلام-فروردين-1393&amp;catid=10&amp;Itemid=2596">سيد مهدی ميرداماد - كليپ بی تو زهرا عليها السلام ... فروردين 1393</a>

Another good one is top one has generated code as:
<a href="/fa/index.php?option=com_jdownloads&amp;view=download&amp;id=3452:آيا-مقام-حضرت-زهرا-سلام-الله-عليها-بالاتر-است-يا-مقام-حضرت-مريم-عليها-السلام-؟&amp;catid=10&amp;Itemid=2596">آيا مقام حضرت زهرا سلام الله عليها بالاتر است يا مقام حضرت مريم عليها السلام ؟!</a>

My knowledge of Persian script is zero so excuse my ignorance here  In the 'good ones' there are two Persian scripts, which I believe are the same and they are the Download title, not the file name. Is that correct?

Bad one - the bottom one - has generated code as:
<a href="/fa/index.php?option=com_jdownloads&amp;view=download&amp;id=3428:1392&amp;catid=10&amp;Itemid=2596">حاج محمود كريمی - كليپ دستهای مادر ... - 1392</a>
This only has the Download Title once!!
This one has the number 1392 instead of the name. It looks as if the download with id 3428 has something messed up in its database entry. But not sure.
I will need to consult with Arno.

Could you please look at the 'bad' download in the backend to see if file name is OK, and also if you look at it in the jDownloads directory structure.

Colin

[gelöscht durch Administrator]
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: smartgig on 08.04.2015 07:38:44
Dear ColinM,
Thank you for your reply.

I checked the joomla global settings section and confirm that all the SEO settings flags are set as off. (Saved again)
And yes, it has nothing to do with file name but the jDownload entry title.

The working URLs have full jD entry title (even with persian characters) after the id number followed by a "-" character
The 404 URLs doesn't have this entry title after the id number (persian characters are somehow omitted, numbers are kept).

You see, in the bottom of the page, you can proceed to the next pages of that section and all the rest jD entires return 404 error (see attached screenshot)

[gelöscht durch Administrator]
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: ColinM on 08.04.2015 09:59:19
Hi

Do you have Joomla! caching turned on or are you using some other extension that provides caching?  If you have then please turn it off and clear your browsers cache (which browser are you using?).  Then re-test to see if any change. Let me know please.

For the moment let us stay with the 'bad' one at foot of page.  Could you check the bad file on your server file system, either through cPanel if you have that on your server, or through an FTP client such as File Zilla, or by say the eXtplorer extension to double check that the file is there, it has the expected name, and it has the correct permissions.  I do not expect anything to be wrong but it is just to eliminate possibilities.

Make sure you have a copy of the file on your PC.  Then from the Backend Downloads delete the file and save.  Clear your Browsers Cache and reload front end. Please advise what is reported if you now try to download.  It should of course tell you nicely that you cannot.

Next from Backend reload the file from your PC.  Again please advise what happens.

Colin
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: smartgig on 10.04.2015 06:09:46
Hello ColinM,

Thank you for your reply.

I investigated the issue and found that it has to do with the "Alias" of jD download entry.

When I set the "Unicode Alias=ON" in the joomla SEF settings, jD automatically fills the Alias of the download with download title (which is persian).
By having "Unicode Alias=OFF", it automatically drops Persian chars. If there's any number in the title, the number is kept and is set as alias. If there weren't any numbers in the title, the alias is left as blank and would not appear in the URL.

I attached a picture of the jD admin entry of the 'bad' one at foot of the first page.

The alias is automatically set to 1393 and this is causing the problem. The URL wouldn't work because of this alias. If I remove it or change it to something rather than a number (like english chars), it would work. Here's other aliases and the results:

139463456456456456 -> 404 error
139463456456456456a -> 404 error
a139463456456456456 -> Works fine!
139463456456456456dadasd-adas-dasd-asd-asd-asd-asd-asd -> 404 error

It seems that the RegExp which is used for URL parsing has a problem with aliases starting with number...

[gelöscht durch Administrator]
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: ColinM on 11.04.2015 12:50:36
Smartgig
Excellent detective work!  As I understand it if Joomla! setting "Unicode Aliases" in Global Config - Site tab is Yes then it works, but if it is No And the alias starts with a number then it is wrong.  The Joomla! hint says that transliteration  is used but if all of the Persian Characters are dropped then it would seem there is a fault with the Joomla! transliteration as well.
Will of course look into the  RegExp which is used for URL parsing has a problem with aliases starting with a numerical digit.

Colin
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: ColinM on 12.04.2015 09:47:27
Hi
Just some further notes.

jDownloads carries out transliteration by using the transliteration function "public static function transliterate($string)" which is supposed to be in xx-XX.localise.php in the language pack (fa-IR.localise.php for Persian).  This function is not present in the Persian language pack.  The Persian translators have a website http://www.joomlafarsi.com/ which is of course entirely in Persian.  Maybe you could ask them if they plan to add a transliteration table.  A Google search indicates there are transliteration tables available.

Colin
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: smartgig on 12.04.2015 09:58:12
Thank you for your kind reply ColinM,

I figured out why the URLs were working in joomla 2.5 website.
jDownloads doesn't add any part of the alias to the URL when SEO is not active. (Sample link in joomla 2.5)

As a workaround, is it possible to make jD not to ad any part of the alias to URLs?
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: ColinM on 12.04.2015 11:33:05
Hi
Will have to consult with Arno on the way forward here in the short term.  It is an area we had "challenges" with in the early beta versions so we will not want to upset that!  I am not sure but maybe there needs to be a check on where a transliteration function exists in the current site language and then take appropriate action.

There is also the problem that Joomla! 3 seems to have now incorporated a new alias style, and this has also had knock-on effects.

Colin
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: smartgig on 14.04.2015 09:04:58
I didn't get what you meant by transliteration function.
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: ColinM on 14.04.2015 09:42:51
Hi
Transliteration is an alternative way of "translating" sometimes used for aliases.  Transliteration is essentially a look up table where those characters outside the very basic set of Latin characters have a Latin 'equivalent'.  It is relatively straight forward in most European languages, including Cyrillic and Russian. For example the German 'ö' transliterates to 'o'.  Transliteration tables are available for Persian, one such source is http://www.iranicaonline.org/pages/guidelines and there are United Nations published versions.  Hope this helps .

Also it is useful to see https://docs.joomla.org/J3.x:Making_a_Language_Pack_for_Joomla
Colin

PS could you please confirm it is OK if you use Unicode Alias in Joomla!
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: smartgig on 14.04.2015 11:12:31
got it,  Transliteration tables can be used to convert other languages characters to English characters.
Well, with Unicode aliases, Transliteration is not needed, as the original title is directly used in the URL (Which improves SEO)

If I set Unicode Alias to ON then any jD entry that is created after that will work, as it directly uses the download title as the alias stores it in the database. But it doesn't affect the old jD entries because they have been created with having Unicode alias option set to OFF, so a stripped alias (that only contain numbers) is stored in the database.

Adding an option in jD settings to control whether to use the jD alias in the URL or not can fix the problem. Although this is a bug with Joomal URL Parser and the URL Parser should be modified to parse aliases starting with a number correctly.
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: smartgig on 11.06.2015 13:45:38
Have you fixed this bug in the new jDownloads version?
Title: Re: pagination error after upgrading from j2.5 to j3.4
Post by: ColinM on 11.06.2015 16:53:27
smartgig
This is not a specific jD bug but as you say it looks like a Joomla! bug with aliases starting with a digit.  In such a situation it is not productive to put in a fix which one day should no longer be needed.  The root of your problem is, I believe, that the older files did not have unicode aliases, so it would perhaps be better to have a tool that would recompute the aliases from the filename dependant on the current setting of the 'Use UTF-8 ' field in Config - Files and Folders Tab.
This should not upset the Content plugin as that uses Category and Download IDs

Maybe you could enter this into the Suggestions.

If someone has used Transliteration of the file name then there is little that can be done as the original info has gone!  Incidentally have you contacted the Persian Language people about the absence of a transliteration ability?

Colin