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

eZ debug

Timing: Jan 18 2025 15:57:35
Script start
Timing: Jan 18 2025 15:57:35
Module start 'content'
Timing: Jan 18 2025 15:57:35
Module end 'content'
Timing: Jan 18 2025 15:57:35
Script end

Main resources:

Total runtime0.3407 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.8438180.8359
Module start 'content' 0.00640.0054 769.679797.8828
Module end 'content' 0.01180.3289 867.5625528.2734
Script end 0.3407  1,395.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.9628200.0002
Check MTime0.00130.3850200.0001
Mysql Total
Database connection0.00060.172910.0006
Mysqli_queries0.291685.56431410.0021
Looping result0.00160.46441390.0000
Template Total0.328596.410.3285
Template load0.00080.246210.0008
Template processing0.327696.150610.3276
Override
Cache load0.00060.165510.0006
Sytem overhead
Fetch class attribute can translate value0.00080.249210.0008
XML
Image XML parsing0.00030.077510.0003
General
dbfile0.00621.8156200.0003
String conversion0.00000.001530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs