Thai characters not creating alias (for article plugin)

thellie

Member
I keep discovering new things in Fabrik... Love it! ...it's like playing golf though... the more I know, the less I understand... :)

I'm currently creating articles, using the article plugin, dropping data into the placeholders in a template article.

There is only one problem - all my titles need to be in Thai. If I do this with a joomla article, it will automatically drop in a timestamp as the alias, but the Fabrik article plugin adds a number (the id number probably), and the same, bracketed, number to the article title.

I have to manually go through the articles once they've been created to amend both the title and make an English language alias.

It also means I have to redo do this every time there is an update to the original record - on updates, it strips out the manually entered alias (not adding anything at all), but doesn't re-add the bracketed number to the title.

I know this is low priority, being a fairly specific issue (non-English keyboard or multibyte characters?)... and I'm not asking for time to be put into looking for a resolution - just wondering if there's a quick fix, or I'm missing something... :)
 
Hard for me to replicate this, but can you try this:

In ./plugins/fabrik_form/article/article.php, line 521, where we do ...

Code:
$alias = JApplication::stringURLSafe(JStringNormalise::toDashSeparated($data['title']));

... try replacing that line with:

Code:
                if (JFactory::getConfig()->get('unicodeslugs') == 1)
                {
                    $data['alias'] = JFilterOutput::stringURLUnicodeSlug($data['title']);
                }
                else
                {
                    $data['alias'] = JFilterOutput::stringURLSafe($data['title']);
                }

-- hugh
 
Thanks, but it's still a problem...

This error appeared on submission: SyntaxError: Unexpected token < ...and the problem remained

I thought it may be that the code you wrote should have been $alias instead of $data['alias'] in the if statement, so I amended it. The error doesn't appear now, but the problem remains.

What determines the unicodeslug == 1? Where do I l find the field?

My language was still set to English, although I am writing titles etc in Thai.

I changed the language default to Thai (front and back end) - but the outcome is the same. After the first record in Thai is added, subsequent records are given an alias ID (a negative number: ie -2), and a corresponding number is added to the title - ie ??????? (2)
 
Two things:
  1. I've managed to convince my project advisor that the headings should be in English, so the immediate problem is resolved. But, I would still like to be able to do this for Thai text, as it will have many benefits going forward...
  2. Just to clarify about the code I amended - it currently looks like this:
PHP:
    protected function generateNewTitle($id, $catId, &$data)
    {
        $table         = JTable::getInstance('Content');


               if (JFactory::getConfig()->get('unicodeslugs') == 1)
                {
                    $alias = JFilterOutput::stringURLUnicodeSlug($data['title']);
                }
                else
                {
                    $alias = JFilterOutput::stringURLSafe($data['title']);
                }
        $data['alias'] = $alias;
        $title         = $data['title'];
        $titles        = array();
        $aliases       = array();
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top