#1 2014-12-23 11:11:10

dickens
Member
Registered: 2014-06-24
Posts: 8

!! Medias array empty after adding new language -empty in new language

Hello! Have a serious problem, please help! Can't submit a website to a client.

So.. We've set up a website with some languages. Added articles, translations, uploaded medias (jpg, png pictures) and linked to articles. Everything is OK!

Some time later the client asked to add some more languages. So we've added 2 languages in settings->languages.
And now the problem appeared.   Pictures are NOT shown in these NEW languages. When I <ion:trace /> the article there are no medias, the medias array is empty. Empty only in new languages! In other languages everything is OK and pictures are shown!

So, I've tried to unlink medias from articles and then link them again. Not helped. Same problem.

Only after re-uploading images and relinking them to articled solved the problem. 

So now, if I want to add a new language, i need to delete images, re-upload them, link to articles and only in this case my website is working and all pictures are appeared in all languages.

Can anyone else reproduce the bug and confirm the problem?

Please help, I am sure it can be solved with some line, can you please tell us which line of code should be modified.

Offline

#2 2014-12-23 13:21:50

Kink
Ion Tester
From: France
Registered: 2010-06-04
Posts: 581

Re: !! Medias array empty after adding new language -empty in new language

So, if i understand, for some reason, there are no line in the new languages for some media in the table : media_lang.
Can you check it from PhpMyAdmin ?

Instead of deleting and reuploading files, from PhpMyAdmin, insert a new line (or copy) and edit the new language for each media.

But for now, we must solve the problem.


Webmaster / OUF!WEB

Offline

#3 2014-12-29 15:04:22

dickens
Member
Registered: 2014-06-24
Posts: 8

Re: !! Medias array empty after adding new language -empty in new language

Kink, you are right. There is no language values for images in media_lang. So, when I add new language in Ionize admin, media_lang table is not updated. 

I've tried to add a new line for new languages manually via phpMyAdmin and pictures start appearing.

How we can fix this bug ?

Offline

#4 2014-12-29 15:24:56

Kink
Ion Tester
From: France
Registered: 2010-06-04
Posts: 581

Re: !! Medias array empty after adding new language -empty in new language

Ok, what is the content of the file :

/application/config/langage.php

In my file, i have this line :

$config['available_languages'] = array(
	'fr' => 'Français',
	'en' => 'english'
	);

Perhaps you have wrong right access, and system can't write file configuration ?


Webmaster / OUF!WEB

Offline

#5 2014-12-29 15:53:16

dickens
Member
Registered: 2014-06-24
Posts: 8

Re: !! Medias array empty after adding new language -empty in new language

Nope, all new languages are appeared in this file.  The bug is more serious smile

So, what we get:

media_lang is updated only when you add some Title, description to the image!

Try this steps:

1) Upload new image via file manager.
2) ! Add some title, description to the image (in one language or several, no difference)
3) Link this image to some article
4) Check front page (trace or just check if the picture is there). The picture should be there.
5) Now, add new language in admin panel and switch the frontage to this new language.
6) Check the image, there is no image smile yo-ho-ho...

We've tested it on two absolutely different servers and the problem is the same on both.

Interesting thing... If don't make a step 2. So, my image don't have any title or description set  (there is no any rows in media_lang for this picture), the picture is appeared in all languages including new one.

ce sa ce qui se passe ici smile

Offline

#6 2014-12-29 16:31:19

dickens
Member
Registered: 2014-06-24
Posts: 8

Re: !! Medias array empty after adding new language -empty in new language

if we comment application/models/base_model.php    1663 line  the problem is solved somehow.
However, we can brake something else... So I need a true and save solution.

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations