Cannot Create Comment (Invalid Language Code Error)

Author Message

Chad Paulson

Thursday 29 November 2007 10:01:06 am

[11/29/2007 11:50 am] The draft could not be created. (5)
Invalid language code provided. The draft could not be created.

I receive the above error when trying to post a comment under a piece of content. I am passing the correct node id, as well as the proper language code. There are two steps to the comment. Step one is a form button that redirects the user to the edit comment template. Below is the form code for both steps.

Step 1:

<div class="content-action">
<form method="post" action="/cms/index.php/mysiteaccess/content/action">
<input type="hidden" name="ClassIdentifier" value="comment" />
<input type="hidden" name="NodeID" value="312" />
<input type="hidden" name="ContentLanguageCode" value="eng-US" />
<input type="hidden" name="RedirectURIAfterPublish" value="/cms/index.php/mysiteaccess/path/to/content/" />
<input class="button new_comment" type="submit" name="NewButton" value="New comment" />
</form>
</div>

Step 2:

<form enctype="multipart/form-data" method="post" action="/cms/index.php/crowdspring/content/edit/666/1/Array">

<div class="edit">
<div class="class-article-comment">

<h1>Edit Comment - New Comment</h1>

 

<br/>

<div class="block">
<label>Subject</label><div class="labelbreak"></div>
<input type="hidden" name="ContentObjectAttribute_id[]" value="5337" />
<input class="box" type="text" size="70" name="ContentObjectAttribute_ezstring_data_text_5337" value="" />
</div>

<div class="block">

<input type="hidden" name="ContentObjectAttribute_ezstring_data_text_" value="Chad Paulson" />
</div>

<div class="block">
<label>Message</label><div class="labelbreak"></div>
<input type="hidden" name="ContentObjectAttribute_id[]" value="5338" />
<textarea class="box" cols="70" rows="10" name="ContentObjectAttribute_data_text_5338"></textarea>
</div>

<div class="buttonblock">
<input class="defaultbutton" type="submit" name="PublishButton" value="Send for publishing" />
<input class="button" type="submit" name="DiscardButton" value="Discard" />
<input type="hidden" name="MainNodeID" value="312" />
<input type="hidden" name="DiscardConfirm" value="0" />
<input type="hidden" name="NodeID" value="312" />

</div>

</div>
</div>
</form>

So, despite the language code being clearly defined in the initial form (<input type="hidden" name="ContentLanguageCode" value="eng-US" />), I am still receiving me this error.

Jan Komárek

Monday 12 April 2010 1:12:07 pm

Hello,

after one clear cache I see this error on every attempt to edit any content. Even in administration interface. I have no idea what to do. I didnt change any ini settings. Nothinng around languages.

Any ideas what to do? Its EZP 4.1

Thanks for every idea.

Vebloud

Jan Komárek

Monday 12 April 2010 1:31:51 pm

,

Nicolas Pastorino

Tuesday 13 April 2010 3:44:10 am

"

after one clear cache I see this error on every attempt to edit any content. Even in administration interface. I have no idea what to do. I didnt change any ini settings. Nothinng around languages.

Any ideas what to do? Its EZP 4.1

"

Hi Jan,

Are you using a standard eZ Publish installation ? What languages are used ? (you can see this from the administration interface, Setup > Languages ).

Let us know,
Cheers

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Jan Komárek

Thursday 15 April 2010 2:30:50 pm

Hi Nicolas,

thanks for reply. I am using EZ webin Instalation. Version 4.1.0 used languages are cze-CZ (main and only one which really used), eng-US and eng-GB.

Whole site have only few changes in css and settings (image sizes and other small things).

Jan

Nicolas Pastorino

Friday 16 April 2010 2:08:39 am

We may need more debug info about this. Would you mind turning you eZ Publish instance into debug mode, as follows (to be written either in a global override of site.ini, weither in the siteaccess' ) :

[DebugSettings]
DebugOutput=enabled

[TemplateSettings]
Debug=enabled
ShowXHTMLCode=disabled
ShowUsedTemplates=enabled
DevelopmentMode=enabled

[ContentSettings]
ViewCaching=disabled

and tell us if you see any valuable information when the error occurs ?

Let us know,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Jan Komárek

Friday 16 April 2010 8:01:52 am



Error: eZLocale Apr 16 2010 15:14:55
Could not load country settings for CZ
Error: eZLocale Apr 16 2010 15:14:55
Could not load language settings for cze
Timing: Apr 16 2010 15:14:55
Module start 'content'
Error: Can not find language. Apr 16 2010 15:14:55
No such locale cze-CZ!
Debug: ezi18n Apr 16 2010 15:14:55
No translation for file(translation.ts) in context(lib/template): 'The maximum nesting level of %max has been reached. The execution is stopped to avoid infinite recursion.' with comment()
Error: error/view.php Apr 16 2010 15:14:55
Error ocurred using URI: /index.php/ezwebin_site_admin/content/edit/66/f/cze-CZ
Notice: Apr 16 2010 15:14:55
eZTemplate: Loading template "error/kernel/5.tpl" with resource "design"
Notice: Apr 16 2010 15:14:55
design/admin/templates/error/kernel/5.tpl, iso-8859-1
Warning: PHP Apr 16 2010 15:14:55
DOMDocument::relaxNGValidate() [<a href='domdocument.relaxngvalidate'>domdocument.relaxngvalidate</a>]: I/O warning : failed to load external entity &quot;/var/www/vhosts/domecekukostku.cz/httpdocs/schemas/translation/ts.rng&quot; in /var/www/vhosts/domecekukostku.cz/httpdocs/lib/ezi18n/classes/eztstranslator.php on line 359
Warning: PHP Apr 16 2010 15:14:55
DOMDocument::relaxNGValidate() [<a href='domdocument.relaxngvalidate'>domdocument.relaxngvalidate</a>]: xmlRelaxNGParse: could not load /var/www/vhosts/domecekukostku.cz/httpdocs/schemas/translation/ts.rng in /var/www/vhosts/domecekukostku.cz/httpdocs/lib/ezi18n/classes/eztstranslator.php on line 359
Warning: PHP Apr 16 2010 15:14:55
DOMDocument::relaxNGValidate() [<a href='domdocument.relaxngvalidate'>domdocument.relaxngvalidate</a>]: Invalid RelaxNG in /var/www/vhosts/domecekukostku.cz/httpdocs/lib/ezi18n/classes/eztstranslator.php on line 359
Warning: eZTSTranslator::loadTranslationFile Apr 16 2010 15:14:55
XML text for file extension/ezwebin/translations/cze-CZ/translation.ts did not validate
Warning: PHP Apr 16 2010 15:14:55
DOMDocument::relaxNGValidate() [<a href='domdocument.relaxngvalidate'>domdocument.relaxngvalidate</a>]: I/O warning : failed to load external entity &quot;/var/www/vhosts/domecekukostku.cz/httpdocs/schemas/translation/ts.rng&quot; in /var/www/vhosts/domecekukostku.cz/httpdocs/lib/ezi18n/classes/eztstranslator.php on line 359
Warning: PHP Apr 16 2010 15:14:55
DOMDocument::relaxNGValidate() [<a href='domdocument.relaxngvalidate'>domdocument.relaxngvalidate</a>]: xmlRelaxNGParse: could not load /var/www/vhosts/domecekukostku.cz/httpdocs/schemas/translation/ts.rng in /var/www/vhosts/domecekukostku.cz/httpdocs/lib/ezi18n/classes/eztstranslator.php on line 359
Warning: PHP Apr 16 2010 15:14:55
DOMDocument::relaxNGValidate() [<a href='domdocument.relaxngvalidate'>domdocument.relaxngvalidate</a>]: Invalid RelaxNG in /var/www/vhosts/domecekukostku.cz/httpdocs/lib/ezi18n/classes/eztstranslator.php on line 359
Warning: eZTSTranslator::loadTranslationFile Apr 16 2010 15:14:55
XML text for file extension/ezoe/translations/cze-CZ/translation.ts did not validate
Warning: PHP Apr 16 2010 15:14:55
DOMDocument::relaxNGValidate() [<a href='domdocument.relaxngvalidate'>domdocument.relaxngvalidate</a>]: I/O warning : failed to load external entity &quot;/var/www/vhosts/domecekukostku.cz/httpdocs/schemas/translation/ts.rng&quot; in /var/www/vhosts/domecekukostku.cz/httpdocs/lib/ezi18n/classes/eztstranslator.php on line 359
Warning: PHP Apr 16 2010 15:14:55
DOMDocument::relaxNGValidate() [<a href='domdocument.relaxngvalidate'>domdocument.relaxngvalidate</a>]: xmlRelaxNGParse: could not load /var/www/vhosts/domecekukostku.cz/httpdocs/schemas/translation/ts.rng in /var/www/vhosts/domecekukostku.cz/httpdocs/lib/ezi18n/classes/eztstranslator.php on line 359
Warning: PHP Apr 16 2010 15:14:55
DOMDocument::relaxNGValidate() [<a href='domdocument.relaxngvalidate'>domdocument.relaxngvalidate</a>]: Invalid RelaxNG in /var/www/vhosts/domecekukostku.cz/httpdocs/lib/ezi18n/classes/eztstranslator.php on line 359
Warning: eZTSTranslator::loadTranslationFile Apr 16 2010 15:14:55
XML text for file extension/ezodf/translations/cze-CZ/translation.ts did not validate
Debug: eZTSTranslator::loadTranslationFile: tried paths Apr 16 2010 15:14:55
extension/ezwebin/translations/cze-CZ/utf-8/translation.ts
extension/ezwebin/translations/cze-CZ/translation.ts
extension/ezoe/translations/cze-CZ/utf-8/translation.ts
extension/ezoe/translations/cze-CZ/translation.ts
extension/ezodf/translations/cze-CZ/utf-8/translation.ts
extension/ezodf/translations/cze-CZ/translation.ts

I checked tanslation file in ezwebin package. And its on proper place.

In country.ini fole are czech settings:

[CZ]
Name=Czech Republic
Alpha2=CZ
Alpha3=CZE
IDC=420

Nicolas Pastorino

Monday 19 April 2010 12:16:33 am

Can you confirm these files exist, are accessible by the Apache/Webserver user, and are not empty :

  • <ezroot>/share/translations/cze-CZ/translation.ts
  • <ezroot>/share/locale/cze-CZ.ini

?

Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Jan Komárek

Monday 19 April 2010 3:13:31 am

I can only unbelievably stare on place where whole share directory should be! I have no idea how this could happend. I dont remember any activity on FTP or anything else what could delete this folder.

But this is it. I upload share folder from clear EZ Publish package and everything is OK.

Thank you very much. You just save me a lot of time.

Nicolas Pastorino

Monday 19 April 2010 3:20:40 am

I can picture you staring at the file explorer, puzzled (not laughing ;) ).

Good to have this solved!

Cheers Jan !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

valentin maior

Monday 11 April 2011 6:03:37 am

Thanks a lot guys...had same problem after retrieving project from ftp....saved half of my day.

Nicolas Pastorino

Monday 11 April 2011 6:17:01 am

"

Thanks a lot guys...had same problem after retrieving project from ftp....saved half of my day.

"

Good to read, that was a useful thread it seems !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

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