Error creating a new object

Author Message

Neidy Tunzine

Thursday 07 June 2007 12:01:07 am

whenever i create a new object in the user interface i get the following error:
Erro / kernel (3)

<b>Error message</b>
The language code [] specified in ContentLanguageCode does not exist in the system.
error/view.php:
Error ocurred using URI: /por/content/action

<form method="post" action={"content/action/"|ezurl}>
            <input class="button forum-new-topic" type="submit" name="NewButton" value="{'New topic'|i18n( 'design/ezwebin/full/forum' )}" />
            <input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
            <input type="hidden" name="ContentObjectID" value="{$node.contentobject_id.}" />
			<input type="hidden" name="ContentLanguageCode" value="{ezini( 'RegionalSettings', 'Locale', 'site.ini')}" />
			<input type="hidden" name="NodeID" value="{$node.node_id}" />
            <input type="hidden" name="ClassIdentifier" value="forum_topic_maputo" />
</form>
 

I am running EzPublish version 3.9.0

Hope to get a reply soon and Thanks in advance!

Regards,
Neidy

http://www.mzbusiness.com

Łukasz Serwatka

Friday 08 June 2007 6:56:31 am

Hi,

Possible reasons that you have got such error message are:
1. ContentLanguageCode POST variable has no value
2. Language does not exist in database, check ezcontent_language table. Also check languages in Setup->Languages

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

Łukasz Serwatka

Friday 08 June 2007 9:30:45 am

In addition make sure that your site.ini.RegionalSettings.SiteLanguageList[] contains all necessary locales.

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

Neidy Tunzine

Saturday 09 June 2007 1:08:51 am

Hi Lukasz,

I checked if the language exists in setup>languages, and i changed the code to make sure <i>ContentLanguageCode</i> has the right value, but i still have the same problem.

<form method="post" action={"content/action/"|ezurl}>
<input class="button forum-new-topic" type="submit" name="NewButton" value="{'New topic'|i18n( 'design/ezwebin/full/forum' )}" />
<input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
<input type="hidden" name="ContentObjectID" value="{$node.contentobject_id.}" />
<input type="hidden" name="ContentLanguageCode" value="por-MZ" />
<input type="hidden" name="NodeID" value="{$node.node_id}" />
<input type="hidden" name="ClassIdentifier" value="forum_topic_maputo" />
</form>

http://www.mzbusiness.com

Łukasz Serwatka

Saturday 09 June 2007 3:26:50 am

Hi again,

SiteLanguageList[] contains your locale?

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

Julien Plesniak

Tuesday 31 July 2007 12:03:01 am

Do you find the problem? i have the same :(

My Form:

<form method="post" action={"content/action/"|ezurl}>
            <input class="button forum-new-topic" type="submit" name="NewButton" value="{'New topic'|i18n( 'design/ezwebin/full/forum' )}" />
            <input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
            <input type="hidden" name="ContentObjectID" value="{$node.contentobject_id.}" />
            <input type="hidden" name="ContentLanguageCode" value="{ezini( 'RegionalSettings', 'Locale', 'site.ini')}" />
            <input class="button forum-keep-me-updated" type="submit" name="ActionAddToNotification" value="{'Keep me updated'|i18n( 'design/ezwebin/full/forum' )}" />
            <input type="hidden" name="NodeID" value="{$node.node_id}" />
            <input type="hidden" name="ClassIdentifier" value="forum_topic" />
        </form>

My file site.ini.append.php

[RegionalSettings]
Locale=fre-FR
ContentObjectLocale=fre-FR
ShowUntranslatedObjects=enabled
SiteLanguageList[]=fre-FR
TextTranslation=enabled

And the source when i launch my form:

  <form method="post" action="/index.php/fre/content/action">
            <input class="button forum-new-topic" type="submit" name="NewButton" value="Nouveau sujet" />
            <input type="hidden" name="ContentNodeID" value="412" />
            <input type="hidden" name="ContentObjectID" value="486" />
            <input type="hidden" name="ContentLanguageCode" value="fre-FR" />
            <input class="button forum-keep-me-updated" type="submit" name="ActionAddToNotification" value="Me tenir informé" />
            <input type="hidden" name="NodeID" value="412" />
            <input type="hidden" name="ClassIdentifier" value="forum_topic" />
        </form>

thanks for help

Julien Plesniak

Tuesday 31 July 2007 12:50:59 am

The problem is in the file kernel/content/action.php

if ( $http->hasPostVariable( 'ContentLanguageCode' ) )
    {
        include_once( 'kernel/classes/ezcontentlanguage.php' );
        $languageCode = $http->postVariable( 'ContentLanguageCode' );
        $languageID = eZContentLanguage::idByLocale( $languageCode );
        if ( $languageID === false )
        {
            eZDebug::writeError( "The language code [$languageCode] specified in ContentLanguageCode does not exist in the system." );
            return $module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' );
        }
    }

If i do an echo $languageCode; , it return "" and if i write
$languageCode = "fre-FR";

the script work.

Does someone have an idea?

thanks

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:25:02
Script start
Timing: Jan 18 2025 11:25:02
Module start 'layout'
Timing: Jan 18 2025 11:25:02
Module start 'content'
Timing: Jan 18 2025 11:25:03
Module end 'content'
Timing: Jan 18 2025 11:25:03
Script end

Main resources:

Total runtime0.9239 sec
Peak memory usage4,096.0000 KB
Database Queries71

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.3359153.4609
Module start 'layout' 0.00640.0031 742.796939.3906
Module start 'content' 0.00960.9128 782.1875639.8594
Module end 'content' 0.92230.0015 1,422.046920.1641
Script end 0.9238  1,442.2109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4232160.0002
Check MTime0.00170.1856160.0001
Mysql Total
Database connection0.00070.075610.0007
Mysqli_queries0.849091.8914710.0120
Looping result0.00080.0833690.0000
Template Total0.887096.020.4435
Template load0.00240.255920.0012
Template processing0.884695.753120.4423
Template load and register function0.00020.023310.0002
states
state_id_array0.00080.091010.0008
state_identifier_array0.00080.082920.0004
Override
Cache load0.00210.2249480.0000
Sytem overhead
Fetch class attribute can translate value0.00080.082830.0003
Fetch class attribute name0.00120.133580.0002
XML
Image XML parsing0.00100.106030.0003
class_abstraction
Instantiating content class attribute0.00000.0027100.0000
General
dbfile0.00100.1042180.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 38
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs