Aliases for SEF-Links are not saved

Phoca Download - download manager
hwevers
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 05 May 2009, 13:18

Re: Aliases for SEF-Links are not saved

Post by hwevers »

After updating to 1.1.0 I have almost the same problem. In my case the alias field is either empty or contain 1 or two characters. THis is for all aliases saved with the phoca download code. All werked ok with the previous version, so there seems to be an annoying bug in the latest version. My workaround is to go into phpMyadmin and fill in the correct alias. However, when you need to change something in a file, category or section record the alias gets distorted again. Pity.
Henk
later... hmmm I see that the previous post has a german site, and mine is dutch. Can this have something to do with the language? I'm going to test this.... I'll come bac
Ok, changed to us-english in the backend. Things changed I tried alias php_5_2 and it has changed to p-p_5_2 better but not quite. saving again gave the same result. Back to php_5_2 and I get p-p_5_2 again. Ok now for abcdefghijklmnopqrstuvwxyz. That becomes only a "p".
Please try to find this, it's rather important that people can find their page back with SEF (internal) on. :cry:

PS, about free software: see www.jfusion.org on integrating your forum with Joomla. I'm one of the core programmers there.
Tx
Henk
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48743
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Aliases for SEF-Links are not saved

Post by Jan »

Hi, I didn't do any changes in Alias creating, there is still the same function from beginning Phoca Download :( :( :(

Please see the following code:

administrator\components\com_phocadownload\tables\phocadownload.php
administrator\components\com_phocadownload\tables\phocadownloadcat.php
administrator\components\com_phocadownload\tables\phocadownloadsec.php

Try to remove tho code which works with iconv and let me know if it helped.

Jan
If you find Phoca extensions useful, please support the project
hwevers
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 05 May 2009, 13:18

Re: Aliases for SEF-Links are not saved

Post by hwevers »

Hey Jan,
Head on, the pregreplace stuff is not working as you expected:
This is the debugcode

Code: Select all

  if (function_exists('iconv')) {
echo "1: ";echo $this->alias;echo"<br>";
        $this->alias = preg_replace('~[^\\pL0-9_.]+~u', '-', $this->alias);
echo "2: ";echo $this->alias;echo"<br>";
        $this->alias = trim($this->alias, "-");
echo "3: ";echo $this->alias;echo"<br>";
        $this->alias = iconv("utf-8", "us-ascii//TRANSLIT", $this->alias);
echo "4: ";echo $this->alias;echo"<br>";
        $this->alias = strtolower($this->alias);
echo "5: ";echo $this->alias;echo"<br>";
        $this->alias = preg_replace('~[^-a-z0-9_.]+~', '', $this->alias);
echo "6: ";echo $this->alias;echo"<br>";  die('@@');
 
I entered bc123._abc as alias. This is the output

Code: Select all

1: bc123._abc
2: -123._-
3: 123._
4: 123._
5: 123._
6: 123._
@@
Not quite what you wanted I think.
Until you have a fix (I have no idea what the iconv function does) I change

Code: Select all

if (function_exists('iconv')) { 

into

Code: Select all

if (function_exists('iconv') && false) {   
In all three files, and the problem is fixed for now
Tx Henk
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48743
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Aliases for SEF-Links are not saved

Post by Jan »

:-(

I get this:

Code: Select all

1: bc123._abc
2: bc123._abc
3: bc123._abc
4: bc123._abc
5: bc123._abc
6: bc123._abc
It seems like there is some problem in:

$alias = preg_replace('~[^\\pL0-9_.]+~u', '-', $alias);

on your server. :-(

This piece of code should solve creating aliases from strings which are saved under utf-8 and include some diacritics. Standard Joomla! alias creating doesn't work for some diacritics characters.

I will change it for next version, so it will be in parameters and can be enabled/disabled.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9705
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Aliases for SEF-Links are not saved

Post by Benno »

Hi all,
I can confirm the Alias issue. My workaround is creating Alias with phpMyAdmin in the database. Not very comfortable, but it works. With other components eg. Phoca Gallery Alias creating is no problem in my joomla configuration. :idea:
Kind regards,
Benno
Post Reply