Forums / Setup & design / Disabling language selection in forum

Disabling language selection in forum

Author Message

Jeroen Sangers

Moderated by: Nicolas Pastorino

Wednesday 10 May 2006 1:30:49 am

After upgrading to version 3.8, a language selection screen appears when you post a new topic to a forum. This is very confusing for the users of the forum. Is there a way to create automatically forum posts in the default language of the current siteaccess?

Łukasz Serwatka

Wednesday 10 May 2006 1:41:12 am

Hello,

Look at this topic:
http://ez.no/community/forum/setup_design/language_of_content_creation_in_the_frontend_3_8/re_language_of_content_creation_in_the_fronten__5

In case where you use only one siteaccess (one language) use e.g:

<input type="hidden" name="ContentLanguageCode" value="eng-GB" />

eZ publish should also skip page where user will choose language if there are no more than 1 languages.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Jeroen Sangers

Wednesday 10 May 2006 9:40:07 am

I have added your code to the /design/siteaccess/override/templates/edit/forum_topic.tpl file and cleared my caches, but it still asks me for the language if I create a new forum topic. Am I using the right template?

Łukasz Serwatka

Wednesday 10 May 2006 10:20:27 am

Nope, you need to put it in code where you triggering object creation, look on full view template forum_topic.tpl. How many languages do you use on your site?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Jeroen Sangers

Wednesday 10 May 2006 11:06:17 am

Thanks, that did the trick. As I have three languages, I used the multi-language code you gave in the other post.

Jeroen Sangers

Friday 12 May 2006 2:03:56 am

Is there also a way to accomplish the same for forms that are not launched through a form? E.g. the "Edit account" link, which simply links to the page

/content/edit/14

After the language selection I am on page

/content/edit/14/13/eng-GB

.

Kristof Coomans

Sunday 21 May 2006 11:42:02 pm

Hi Jeroen

You can use

/content/edit/14/f/eng-GB

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

André Pérez

Thursday 01 June 2006 4:25:51 am

Hello Kristof,

I try to use your solution but I get the next error:

Fatal error: Call to a member function on a non-object in D:\aperez\Workspace\Indubanda\kernel\content\attribute_edit.php on line 85
Fatal error: eZ publish did not finish its request

The execution of eZ publish was abruptly ended, the debug output is present below.

I have investigated the error and the problem is in the call to the function "eZContentObjectVersion::fetchVersion" (ezcontentobject.php - line 936). It returns an empty object for version "f".

I have upgraded my site from eZ 3.6 to eZ 3.8. Is this a bug or a problem with my database?

Kristof Coomans

Thursday 01 June 2006 4:48:46 am

Hi André

It works here, so I guess the problem is on your installation.

What kind of object are you trying to edit?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

André Pérez

Thursday 01 June 2006 5:03:12 am

It's a custom object, but I have the same problem with "article" and "folder" :(

Is there any script to check my database?

André Pérez

Tuesday 06 June 2006 1:53:23 am

I have found the problem and the solution :) It's a bug in eZp.

The problem appears when you use

/content/edit/14/f/eng-GB

and the option

EditDirtyObjectAction=usecurrent

In "kernel/content/edit.php", block code from line 348 to 363:

    if ( $ini->variable( 'ContentSettings', 'EditDirtyObjectAction' ) == 'usecurrent' )
    {
        {.......}
        $version->store();
    }

After "$version->store();", the code must be redirected to edit the new version like in line 436:

    if ( $ini->variable( 'ContentSettings', 'EditDirtyObjectAction' ) == 'usecurrent' )
    {
        {.......}
        $version->store();
        return $Module->redirectToView( "edit", array( $ObjectID, $version->attribute( "version" ), $EditLanguage ) );
    }

PS: excuse me for my poor english :P

Kristof Coomans

Tuesday 06 June 2006 2:39:08 am

Hi André

Can you report it as a bug on ez.no? You can refer to this thread.

Thanks!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Kristof Coomans

Tuesday 06 June 2006 11:51:51 pm

Hi André

It seems that this was already reported: http://ez.no/bugs/view/8261 . It is fixed in svn.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

André Pérez

Wednesday 07 June 2006 12:57:42 am

Good :)

Regards.

/dev/null

Sunday 10 December 2006 8:42:21 am

I would like to see how one might use a user setting to control the default language setting in the way you describe.

Some kind of user setting menu to select from available languages, storage of selection, option to prompt each time.

Template logic to fetch user setting for default language to pass back to eZ publish in the way you describe.

Your thoughts on this idea?

<i>/dev/null</i>

eZpedia community documentation project: http://ezpedia.org

Stefano Maffulli

Wednesday 21 February 2007 3:57:06 am

/dev/null:

we have used a different approach as discussed here:
http://ez.no/community/forum/setup_design/choosing_language_at_publishing_time

We have created a new template:

<select name="ContentLanguageCode">
{def $site_languages=ezini('RegionalSettings', 'SiteLanguageList')}
{def $locales=fetch('content','locale_list')}
{foreach $site_languages as $lang}
         {foreach $locales as $locale}
                  {if eq($locale.locale_code, $lang)}
                      <option value="{$locale.locale_code}">{$locale.language_name}</option>
                      {break}
                  {/if}
         {/foreach}
{/foreach}
</select>

so that close to all our 'create' and 'edit' buttons we get a dropdown list to select the language we need. I think this solution makes the multilanguage function easier to use.

--
: Stefano Maffulli : https://www.fsfe.org/en/fellows/maffulli/
`--------+----------+--------------------------------------------------.
Join the Fellowship of FSFE http://fsfe.org

Luc Chase

Monday 18 June 2007 9:52:32 am

Also see this post... http://ez.no/community/forum/setup_design/choosing_language_at_publishing_time/re_choosing_language_at_publishing_time__5

The Web Application Service Provider

eZ debug

Timing: Jan 18 2025 01:12:43
Script start
Timing: Jan 18 2025 01:12:43
Module start 'content'
Timing: Jan 18 2025 01:12:44
Module end 'content'
Timing: Jan 18 2025 01:12:45
Script end

Main resources:

Total runtime1.2612 sec
Peak memory usage4,096.0000 KB
Database Queries263

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0101 588.9453180.8281
Module start 'content' 0.01011.0455 769.7734905.6563
Module end 'content' 1.05560.2054 1,675.4297362.5703
Script end 1.2611  2,038.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00590.4665210.0003
Check MTime0.00160.1252210.0001
Mysql Total
Database connection0.00060.047210.0006
Mysqli_queries1.111488.12912630.0042
Looping result0.00490.38952610.0000
Template Total1.209695.920.6048
Template load0.00410.323120.0020
Template processing1.205595.587220.6028
Template load and register function0.00010.006310.0001
states
state_id_array0.00360.287510.0036
state_identifier_array0.00280.221120.0014
Override
Cache load0.00390.3107870.0000
Sytem overhead
Fetch class attribute can translate value0.00190.148780.0002
Fetch class attribute name0.00150.1175210.0001
XML
Image XML parsing0.00260.204780.0003
class_abstraction
Instantiating content class attribute0.00010.0054280.0000
General
dbfile0.01331.0571470.0003
String conversion0.00000.000530.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
11content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
17content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
28content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
10content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 70
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs