Page 1 of 1

Alias Problem

Posted: Thu Aug 01, 2019 2:33 pm
by christoforosKor
Hello,
I have a strange problem with one of my clients. Some of the articles he submits are created with wrong alias. Only a part of the titlie is becoming alias.

Bellow 3 examples:
Article:
"Όμιλος ΑΧΑ: Ισχυρές επιδόσεις και το α΄ 6μηνο του 2019"
Has alias
"6-2019"

Article
"RFID: Ένας ακρογωνιαίος λίθος στην ασφάλεια γραφείου"
Has alias
"rfid"

Article
"Σχέδιο για περικοπές 1.500 θέσεων εργασίας δρομολογεί η Ryanair"
Has alias
"1-500-ryanair"

Any help is appreciated

Re: Alias Problem

Posted: Thu Aug 01, 2019 2:55 pm
by imanickam
Is your client using Joomla! 4? If the answer is Yes, I am surprised as current version of Joomla! 4 is Alpha 10 - The software not in its Beta state.

I have tested the mentioned scenario in Joomla! 4 Alpha 10 without any third party extension.

For the article titled "Όμιλος ΑΧΑ: Ισχυρές επιδόσεις και το α΄ 6μηνο του 2019", the system created the alias "όμιλος-αχα-ισχυρές-επιδόσεις-και-το-α΄-6μηνο-του-2019" and for the article titled "RFID: Ένας ακρογωνιαίος λίθος στην ασφάλεια γραφείου", the system created the alias "rfid-ένας-ακρογωνιαίος-λίθος-στην-ασφάλεια-γραφείου".

Make sure that in the Global Configuration, in the tab Site, in the section SEO Settings, following options are set as shown:
Search Engine Friendly URLs - Yes
Unicode Aliases - Yes

Re: Alias Problem

Posted: Fri Aug 02, 2019 3:16 am
by christoforosKor
We don't use Unicode aliases because of the url encoding appearance when copying the url. I will check to see if this is the problem.
Thank you.

Re: Alias Problem

Posted: Fri Aug 02, 2019 3:45 am
by imanickam
christoforosKor wrote:
Fri Aug 02, 2019 3:16 am
We don't use Unicode aliases because of the url encoding appearance when copying the url
Understood. Please see the following URLs that were copied from a browser's address bar.

Code: Select all

http://localhost/joomla_39_10_test/index.php/rfid-%CE%AD%CE%BD%CE%B1%CF%82-%CE%B1%CE%BA%CF%81%CE%BF%CE%B3%CF%89%CE%BD%CE%B9%CE%B1%CE%AF%CE%BF%CF%82-%CE%BB%CE%AF%CE%B8%CE%BF%CF%82-%CF%83%CF%84%CE%B7%CE%BD-%CE%B1%CF%83%CF%86%CE%AC%CE%BB%CE%B5%CE%B9%CE%B1-%CE%B3%CF%81%CE%B1%CF%86%CE%B5%CE%AF%CE%BF%CF%85

Code: Select all

localhost/joomla_39_10_test/index.php/rfid-ένας-ακρογωνιαίος-λίθος-στην-ασφάλεια-γραφείου
The second URL has been copied from the browser's address bar after adding a space at the end of the URL. I do understand that it is a bit of inconvenience; but, solves the problem.

Please let us know what version of Joomla is being used.

Re: Alias Problem

Posted: Fri Aug 02, 2019 7:18 am
by christoforosKor
imanickam wrote:
Fri Aug 02, 2019 3:45 am
Please let us know what version of Joomla is being used.
I am using joomla! 4 7 alpha

Re: Alias Problem

Posted: Fri Aug 02, 2019 8:22 am
by toivo
christoforosKor wrote:I have a strange problem with one of my clients.
Alpha and beta versions are not meant for customer use, unless they are just testing, because the development versions are not ready for live production sites.

Re: Alias Problem

Posted: Sat Aug 03, 2019 4:24 am
by christoforosKor
toivo wrote:
Fri Aug 02, 2019 8:22 am
christoforosKor wrote:I have a strange problem with one of my clients.
Alpha and beta versions are not meant for customer use, unless they are just testing, because the development versions are not ready for live production sites.
We are preparing for the transition to Joomla! 4 and the above and some other are problems we are facing. I thought that you would find it usefull to know about these problems.

Re: Alias Problem

Posted: Sat Aug 03, 2019 4:30 am
by christoforosKor

Code: Select all

localhost/joomla_39_10_test/index.php/rfid-ένας-ακρογωνιαίος-λίθος-στην-ασφάλεια-γραφείου
The second URL has been copied from the browser's address bar after adding a space at the end of the URL. I do understand that it is a bit of inconvenience; but, solves the problem.

Please let us know what version of Joomla is being used.
This is a workaround but does not solve the problem, which is the bad transilteration. Perhaps If you can point me to the piece of code that do this job I would solve it.

Anyway if there is no other answer I will accept this as the correct, beacuse it is a workaround.

Re: Alias Problem

Posted: Sat Aug 03, 2019 6:58 am
by infograf768
IMPORTANT:

This has nothing to do with the Joomla version. The following explanation is the same for 3.x or 4.x

If you do not want to use unicode aliases but need transliteration, the alias obtained depends on the language pack in use.

Are you using the Greek language in admin when you create these Titles?

If not, what you obtain is the default transliteration for Joomla which ONLY works for latin characters.
It deletes any non-latin glyphs and thereafter the result depend if you have or not some parts in latin alphabet in the title:

If some latin alphabet, the automatic alias will be created with these only.
If no latin alphabet, it will be the date the item is created.

If you use Greek in backend you would obtain a specific transliteration for Latin AND Greek.

The Greek pack is not available for 4.0, but you can, for test purposes, install the 3.x pack
http://joomlacode.org/gf/download/frsre ... .9.7v1.zip

Then you need to correct the el-GR.localise.php as it is not compatible with 4.0 (both in site and admin language folder)
Change line 92

Code: Select all

$str = JString::strtolower($string);
to

Code: Select all

$str = \Joomla\String\StringHelper::strtolower($string);
You will obtain as alias
"omilos-axa-isxyres-epidoseis-kai-to-a-6mino-tou-2019"
for the title
"Όμιλος ΑΧΑ: Ισχυρές επιδόσεις και το α΄ 6μηνο του 2019"

NOTE 1:
If you were using unicode aliases, a unicode url copy/paste will depend on the browser in use.

Safari: one gets utf8

Code: Select all

http://localhost:8888/installmulti/joomla40/en/31-όμιλος-αχα-ισχυρές-επιδόσεις-και-το-α΄-6μηνο-του-2019
Firefox and Chrome: one gets percent encodings

Code: Select all

http://localhost:8888/installmulti/joomla40/en/31-%CF%8C%CE%BC%CE%B9%CE%BB%CE%BF%CF%82-%CE%B1%CF%87%CE%B1-%CE%B9%CF%83%CF%87%CF%85%CF%81%CE%AD%CF%82-%CE%B5%CF%80%CE%B9%CE%B4%CF%8C%CF%83%CE%B5%CE%B9%CF%82-%CE%BA%CE%B1%CE%B9-%CF%84%CE%BF-%CE%B1%CE%84-6%CE%BC%CE%B7%CE%BD%CE%BF-%CF%84%CE%BF%CF%85-2019
NOTE 2:
Some packs, like the French language pack, do contain custom transliteration for Greek as well as Cyrillic glyphs.

Re: Alias Problem

Posted: Sat Aug 03, 2019 4:00 pm
by infograf768
BTW: a xx-XX.localise.php can be overriden, which means you could use the Greek language pack el-GR.localise.php transliteration ( `public static function transliterate($string)` method) with other languages by placing these in the Site language/overrides/en-GB.localise.php for example by just adding the method in a copy of en-GB.localise.php