Forums / Developer / Problem with language_mask

Problem with language_mask

Author Message

luis muñoz

Tuesday 19 December 2006 4:12:41 am

Hi,

I,m using ez 3.8.6 upgraded from previous version. Everything works fine, multilingual is nice but i think i've found a problem.
I need to make the content in my forums always available. I found in the documentation that an object is alwais available when language_mask is odd, so i decided to make an sql wich add 1 to all the objects of the forum and forum reply class.
I found language mask present in two tables ezcontentobject and ezcontentobject_version but then i noticed the weird thing.
I ran two queryes:

select count(id) from ezcontentobject_version where MOD(language_mask,2)=1;

and

select count(id) from ezcontentobject where MOD(language_mask,2)=1;

and got two different results:
172194 and 21914
Then i decided to look in the database to see where was the problem or what i was doing wrong. I found that the two tables have different content for the same object in the language_mask field. In ezcontentobject i have language mask=250 (even) and in ezcontentobject_version i have 4 versions of the same object with values 123, 251, 251 and 251, all of them odd.
I have checked with and old version of the database (from 1 moth ago) when o updated to 3.8 and get the same results.

Any idea if this is a bug or i'm doing something wrong?
Is there any other way for changing all the object in a class to be alwais available?

Thanks,
Luis

Claudia Kosny

Tuesday 19 December 2006 5:32:16 am

Hi Lius

The number of items in the two tables is different because one contenobject can have several versions. I think of you would count the distinct contentobject_ids in the version table you should get the same number for both (not sure)

Generally I would not worry about the internal workings of EZ for this. To make an object avilable no matter whether it is translated in the current language or not, just tick the checkbox for 'Use the main language if there is no prioritized translation.' for this object (it is in the block translations of the detailed view of the object).

If this should be enabled by default for all objects of this class, tick the checkbox for 'default object availability' when editing the class. Please note that any changes to this setting will not affect existing objects, so you have to change all existing objects manually (or maybe per script).

Check e.g. here
http://ez.no/community/developer/specs/improved_multi_language_in_ez_publish_rev_2
under 'ignoring translation'.

Claudia

luis muñoz

Tuesday 19 December 2006 5:47:28 am

Hi Claudia,
I noticed about versions, that isn't the problem. The problem is that i have diferent values for language_mask in both tables for the same object. I was making the sql to make the manual change to the objects when I noticed that.
I think that the value should be the same in both tables, no mather wich version, but it isn't. I dont wanna change anything in any table until i know if i can change it without later problems.

Thanks,
Luis

luis muñoz

Tuesday 19 December 2006 6:29:24 am

Hi,
I've found another thing:
If i check "Default object availability" in the setup->class menu the new objects are created with the right value in both tables.
Is it possible that the system is only using the table ezcontentobject to see the availability of an object?

Thanks,
Luis

Claudia Kosny

Tuesday 19 December 2006 6:38:38 am

Hi Luis

The way I understand the docu having different language masks this is normal.
Description for language_mask for contentobject:

The sum of the ID numbers of the languages in which the last published version of the object exists. Please note that the ID numbers are powers of 2. 1 (2^0) is reserved for marking objects that should always be available. Objects that are always available will be fetched even if they do not exist in any of the site/prioritized languages (the initial/main language of the object will be used).

Description for language_mask for contentobjectversion:

The sum of the ID numbers of the languages in which the version exists plus 1.

So they are not the same.

Claudia

luis muñoz

Tuesday 19 December 2006 8:57:09 am

Hi Claudia,

Thanks for your help. Looks like you are right. I made an SQL wich modified the content and now it seems to work

Thanks
Luis