Vox Populi(x) forum

Alexandria Book Library => Errori (Bugs) => Topic started by: dski on 19 November 2013, 09:19:04

Title: Problem with aliases in Joomla 2.5 for greek language
Post by: dski on 19 November 2013, 09:19:04
Hi!

I use the Alexandria Library component (version 2.0.4) under Joomla 2.5 and I came across the following problem:

I tried to insert two books using the greek language (book title in greek). The first book was inserted with no problem. When I tried to insert the second one (in the same category) I got an error that there is already a book with the same alias in the same category. After some trials I found out that the problem lies with the greek language in the book title.When all characters are greek it seems that the component (or the Joomla?) generates an empty alias, so when I tried to insert a second book in greek characters the new alias was also empty and there appeared to be a conflict. With the latin characters there is no problem, the aliases are generated properly. The solution was to insert a latin character alias myself but this is not very practical when you have many book to insert. Please also note that this problem appears only with books. With categories or authors with names in greek language the aliases are generated with no problem.

Thanks for your time!

Dimitris
Title: Re: Problem with aliases in Joomla 2.5 for greek language
Post by: federica on 10 December 2013, 11:05:28
Hi Dimitris,
try to insert the same titles in two joomla articles, the aliases are generated correctly?

Can you post some titles in the greek language? I would use them for debug.
Title: Re: Problem with aliases in Joomla 2.5 for greek language
Post by: dski on 03 January 2014, 10:19:22
Hi Federica!

Sorry for my delayed response.

In the Joomla articles the aliases are generated correctly when we use greek characters (I've tested this several times with new articles). The problem seems to appear only with Alexandria Library :-(

Here are some greek book titles to use for debugging:

Η Φόνισσα
Ιστορία του Ευρωπαϊκού Πνεύματος
Ματιές στην Κοινωνία
Λωξάντρα

Thank you again for your time!
Title: Re: Problem with aliases in Joomla 2.5 for greek language
Post by: federica on 20 January 2014, 20:31:58
You're right!

Open the file administrator/components/com_abook/tables/book.php and add this code before the last parenthesis "}"

        public function check()
        {       
                if (trim($this->title) == '')
                {
                        $this->setError(JText::_('COM_CONTENT_WARNING_PROVIDE_VALID_NAME'));
                        return false;
                }
       
                if (trim($this->alias) == '')
                {
                        $this->alias = $this->title;
                }
               
                $this->alias = JApplication::stringURLSafe($this->alias);
               
                if (trim(str_replace('-', '', $this->alias)) == '')
                {
                        $this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');
                }
               
                return true;
        }
Title: Re: Problem with aliases in Joomla 2.5 for greek language
Post by: dski on 17 February 2014, 13:36:17
Hello Federica!

Thank you once more for your help. I added the code to book.php and now it works fine!

Dimitris
Title: Re: Problem with aliases in Joomla 2.5 for greek language
Post by: dski on 16 July 2014, 12:27:12
  Hello Federica,

  Here I am again after quite some time.  The library project was somehow on hold but now I got back to it and face some problems I would like to report.

  I tried to insert some books using a .csv file. My efforts were successful when my data are written in english (latin). However it seems that there are still some problems when using the greek language. When I try to insert a greek title for a book through the .csv file I get the error:

COM_CONTENT_WARNING_PROVIDE_VALID_NAME

which is the same I got when I tried to insert a greek book title through the normal library interface (this problem was resolved by you, see the previous posts in this topic).

  Moreover, when I use a title written in latin and include e.c. a description of the book in greek, the book is inserted correctly but the description is not there!

  It would be useful to be able to insert at least titles in greek language through the .csv file. If you want a test try the titles:

Η Φόνισσα
Ιστορία του Ευρωπαϊκού Πνεύματος
Ματιές στην Κοινωνία
Λωξάντρα

  Thanks for all your support!
Title: Re: Problem with aliases in Joomla 2.5 for greek language
Post by: federica on 25 August 2014, 10:14:01
Hi dski,
I tried to insert a book from csv file without errors. If you try to insert the attached file do you get any error? Rename it to .csv.
Title: Re: Problem with aliases in Joomla 2.5 for greek language
Post by: dski on 02 September 2014, 10:03:36
  Hello Federica,

  I tried to insert the .csv file and got the following error message:

===================================================

        JDatabase::query: SQL Error DB function failed with error number 1064
        You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"Η Φόνισσα","Η Φόνισσα","2014-08-25-08-02-25","0","","0","197","' at line 1 SQL=INSERT INTO e1wnr_abbook (title, subtitle, alias, ideditor, price, pag, user_id, created_by_alias, description, image, file, year, idlocation, idlibrary, vote, numvote, hits, published, qty, isbn, approved, userid, url, url_label, dateinsert, catalogo, checked_out, checked_out_time, access, metakey, metadesc, note, language, editedby, catid) VALUES ("Η Φόνισσα","Η Φόνισσα","2014-08-25-08-02-25","0","","0","197","","

        Η Φόνισσα
        Ιστορία του Ευρωπαϊκού Πνεύματος
        Ματιές στην Κοινωνία
        Λωξάντρ
        ","","","0","0","0","0","0","0","1","1","","0","","","","2014-08-23 15:26:09","","0","0000-00-00 00:00:00","1","","","","*","0",4)
        SQL =

         INSERT INTO #__abbook  (title, subtitle, alias, ideditor, price, pag, user_id, created_by_alias, description, image,  file, year, idlocation, idlibrary, vote, numvote, hits, published, qty, isbn, approved, userid, url, url_label, dateinsert, catalogo, checked_out, checked_out_time, access, metakey, metadesc, note, language, editedby, catid) VALUES ("Η Φόνισσα","Η Φόνισσα","2014-08-25-08-02-25","0","","0","197","","

        Η Φόνισσα
        Ιστορία του Ευρωπαϊκού Πνεύματος
        Ματιές στην Κοινωνία
        Λωξάντρ
        ","","","0","0","0","0","0","0","1","1","","0","","","","2014-08-23 15:26:09","","0","0000-00-00 00:00:00","1","","","","*","0",4)

        An error has occurred

===================================================

  I do not know what causes the syntax error.  Moreover I do not see the authoid field that is supposed to be the last one.

  Thank you in advance for your help.
Title: Re: Problem with aliases in Joomla 2.5 for greek language
Post by: dski on 05 September 2014, 09:14:12
  Hello again!

  It seems that I have overcame some of the problems with the .csv file and I managed to insert some books using greek characters. What I did was to save the .csv file with UTF-8 encoding and then try to insert it. For some reason ANSI but also Unicode keep popping up syntax errors...

  However there are some problems that remain:

1. For some reason the first book in the .csv file is not inserted (?!) and I get a syntax error. However the rest of the books seem to be inserted.

2. There are still problems with aliases not only in greek language. When I leave the alias field empty (in the .csv file) I get an error that another book has the same alias. When I use similar aliases (in greek or latin e.g. for 3 different books: Πληροφορική1 Πληροφορική2 Πληροφορική3 or odigies1 odigies2 odigies3) I get the same error. However when I use random aliases the books are inserted.

3. I still cannot insert the authors using the .csv file. Following your advice I use the author ID of each author (they are already inserted in the library) however the authors do not appear when the books are inserted.

4.  A general problem is that when we click in a book in the library there seems to be some problem with the image of the book and the error message we get is shown in the attached file.  In fact we do not really want any image to appear but something goes wrong...

  Thanks in advance for your time!
Title: Re: Problem with aliases in Joomla 2.5 for greek language
Post by: federica on 30 October 2014, 13:00:48
Hi dski,

Quote from: dski on 05 September 2014, 09:14:121. For some reason the first book in the .csv file is not inserted
2. There are still problems with aliases not only in greek language.
thank you for the notice, I will fix the problem as soon as possible
Quote from: dski on 05 September 2014, 09:14:12
3. I still cannot insert the authors using the .csv file.
is not possible to insert the authors by csv file. The csv import is only a mode to add books to the library

Quote from: dski on 05 September 2014, 09:14:12
4.  A general problem is that when we click in a book in the library there seems to be some problem with the image...
there is php code problem, have you modify the code? Try to reinstall Abook