Forums / Developer / Cannot Create Comment (Invalid Language Code Error)

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

eZ debug

Timing: Jan 30 2025 00:13:21
Script start
Timing: Jan 30 2025 00:13:21
Module start 'content'
Timing: Jan 30 2025 00:13:21
Module end 'content'
Timing: Jan 30 2025 00:13:21
Script end

Main resources:

Total runtime0.1876 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.0781180.8125
Module start 'content' 0.00580.0065 768.8906127.0547
Module end 'content' 0.01230.1751 895.9453561.3750
Script end 0.1874  1,457.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00341.8017200.0002
Check MTime0.00130.6842200.0001
Mysql Total
Database connection0.00060.317610.0006
Mysqli_queries0.141975.61331410.0010
Looping result0.00110.60501390.0000
Template Total0.174793.110.1747
Template load0.00100.532910.0010
Template processing0.173792.588810.1737
Override
Cache load0.00070.364510.0007
Sytem overhead
Fetch class attribute can translate value0.00090.466810.0009
XML
Image XML parsing0.00030.136010.0003
General
dbfile0.00613.2364200.0003
String conversion0.00000.002930.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.0001 secs