Forums / General / Error creating a new object

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