Alias adds item ID after translation

More
11 years 11 months ago #38171 by Rooney
Hi,
just found a bug. I translated articles and moved them to another category. During translation the item ID of the article is added to the alias: _id
When I try to delete the _id it is always added again. I have already English translations and as long as an article is in another category the same article alias is nor problem.
Rooney

Joomla! 3.9.24 and FC 3.3.9

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #38176 by ggppdk
Hello,
this is due to a recent "fix" to avoid duplicate alias in articles,

-- but you are right,
related translations should be allowed to have same alias


I have tested this fix:
(and it works in both cases: allow same alias for related item translations and but disallow for others)
(but please test too)

Edit file:
administrator/components/com_flexicontent/tables/flexicontent_items.php
and replace line:
Code:
$query = 'SELECT COUNT(*) FROM #__content WHERE alias='.$this->_db->Quote($this->alias).' AND id <> '.(int)$this->id;
with:
Code:
$query = 'SELECT COUNT(*) FROM #__content AS i ' .' JOIN #__flexicontent_items_ext AS e ON i.id = e.item_id ' .' WHERE i.alias='.$this->_db->Quote($this->alias) .' AND i.id <> '.(int)$this->id .' AND e.lang_parent_id <> '.(int)$type_ext->lang_parent_id;

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #38214 by Rooney
Hi,
I've changed the code and it seems to work. I am able to change the translated alias to the same name.

Adding the ID to avoid the same alias during translation makes lots of sense if the translation is stored in the same category. But because in many cases category titles have to be also translated moving translation to a different category will be common too.

Rooney

Joomla! 3.9.24 and FC 3.3.9

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.348 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save