Developer forum

Forum » CMS - Standard features » ParagraphEdit.js Backend - Invalid or unexpected token

ParagraphEdit.js Backend - Invalid or unexpected token

Rasmus Thrane
Reply

Hi,


I have a Code first item type called "Module".


There is many languages and the english one is the master.

This ItemType contains a title(string) and a form field called mailchimp(string).
It also contains some other properties which are not used.

Mailchimp field is used by our customer to directly insert forms directly as content.

On the master language the backend view is fine. i can see all the settings and edit them no problem.

On the child languages, i cannot see "mailchimp" and instead some json gets printed in the bottom of the screen. 

I found the value in the database and it looks alright, not corrupted.

I found the javascript(ParagraphEdit.js, function = 'initialize') which throwed the error and viewed the json parameter it received and ran it through a validator.
 The JSON which the function receives is valid...

The error from the console and the json printed on the screen can be found below

 

CODE FIRST ItemType/Paragraph:


Replies

 
Nicolai Pedersen
Reply

Hi Rasmus

What is the value you have in that field? This language feature is not exactly created for moving code around, so that is probably the issue...

 
Rasmus Thrane
Reply

Hi Nicolai.

The field has the value:

 

<!-- Begin Mailchimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own Mailchimp form style overrides in your site stylesheet or in this style block.
   We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
.basic_page h1 {
    display: none;
}
</style>
<div id="mc_embed_signup">
<form action="https://tefcold.us10.list-manage.com/subscribe/post?u=39276d5ae5ae654053ea39044&id=53d889e3c9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">
<h2>Contact formular</h2>
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div><!--Anette: Her oversætter påkrævet felt-->
 
<div class="mc-field-group">
<label for="mce-INTEREST">What are you interested in? </label>
<select name="INTEREST" class="" id="mce-INTEREST">
<option value=""></option>
<option value="Long term sales cooperation">Long term sales cooperation</option><!--Anette: Her oversætter du drop down menuen-->
<option value="Referal to dealer in your region / country">Referal to dealer in your region / country</option>
<option value="Offer on cabinets">Offer on cabinets</option>
<option value="Offer on spare parts">Offer on spare parts</option>
<option value="Offer on cabinets and spare parts">Offer on cabinets and spare parts</option>
<option value="Other">Other</option>
 
</select>
</div>
<div class="mc-field-group"><!--Anette: Herunder oversætter du teksterne til input felterne. Oversæt kun selve teksten :-)-->
<label for="mce-COMPANY">Company  <span class="asterisk">*</span>
</label>
<input type="text" value="" name="COMPANY" class="required" id="mce-COMPANY">
</div>
<div class="mc-field-group">
<label for="mce-FNAME">First Name  <span class="asterisk">*</span>
</label>
<input type="text" value="" name="FNAME" class="required" id="mce-FNAME">
</div>
<div class="mc-field-group">
<label for="mce-LNAME">Last Name  <span class="asterisk">*</span>
</label>
<input type="text" value="" name="LNAME" class="required" id="mce-LNAME">
</div>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Address  <span class="asterisk">*</span>
</label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div class="mc-field-group size1of2">
<label for="mce-PHONE">Phone Number  <span class="asterisk">*</span>
</label>
<input type="text" name="PHONE" class="required" value="" id="mce-PHONE">
</div>
<div class="mc-field-group">
<label for="mce-COUNTRY">Country  <span class="asterisk">*</span>
</label>
 
<select name="COUNTRY" class="required" id="mce-COUNTRY">
<option value=""></option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="Argentina">Argentina</option>
<option value="Armenia">Armenia</option>
<option value="Australia">Australia</option>
<option value="Austria">Austria</option>
<option value="Azerbaijan">Azerbaijan</option>
<option value="Bahrain">Bahrain</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Barbados">Barbados</option>
<option value="Belarus">Belarus</option>
<option value="Belgium">Belgium</option>
<option value="Belize">Belize</option>
<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
<option value="Brazil">Brazil</option>
<option value="British Virgin Islands">British Virgin Islands</option>
<option value="Bulgaria">Bulgaria</option>
<option value="Cameroon">Cameroon</option>
<option value="Canada">Canada</option>
<option value="Canary Islands">Canary Islands</option>
<option value="Chile">Chile</option>
<option value="China">China</option>
<option value="Colombia">Colombia</option>
<option value="Costa Rica">Costa Rica</option>
<option value="Croatia">Croatia</option>
<option value="Cyprus">Cyprus</option>
<option value="Czech Republic">Czech Republic</option>
<option value="Denmark">Denmark</option>
<option value="Dominican Republic">Dominican Republic</option>
<option value="Egypt">Egypt</option>
<option value="Estonia">Estonia</option>
<option value="Faroe Islands">Faroe Islands</option>
<option value="Finland">Finland</option>
<option value="France">France</option>
<option value="French Guiana">French Guiana</option>
<option value="Georgia">Georgia</option>
<option value="Germany">Germany</option>
<option value="Great Britain">Great Britain</option>
<option value="Greece">Greece</option>
<option value="Greenland">Greenland</option>
<option value="Guadeloupe">Guadeloupe</option>
<option value="Hong Kong">Hong Kong</option>
<option value="Hungary">Hungary</option>
<option value="India">India</option>
<option value="Iceland">Iceland</option>
<option value="Ireland">Ireland</option>
<option value="Isle of Man">Isle of Man</option>
<option value="Israel">Israel</option>
<option value="Italy">Italy</option>
<option value="Jersey">Jersey</option>
<option value="Jordan">Jordan</option>
<option value="Kazakhstan">Kazakhstan</option>
<option value="Kenya">Kenya</option>
<option value="Kuwait">Kuwait</option>
<option value="Kyrgyzstan">Kyrgyzstan</option>
<option value="Latvia">Latvia</option>
<option value="Lithuania">Lithuania</option>
<option value="Luxembourg">Luxembourg</option>
<option value="Macedonia, the Former Yugoslav Republic of">Macedonia, the Former Yugoslav Republic of</option>
<option value="Malaysia">Malaysia</option>
<option value="Malta">Malta</option>
<option value="Martinique">Martinique</option>
<option value="Mauritania">Mauritania</option>
<option value="Mauritius">Mauritius</option>
<option value="Moldova, Republic of">Moldova, Republic of</option>
<option value="Montenegro">Montenegro</option>
<option value="Morocco">Morocco</option>
<option value="Netherlands">Netherlands</option>
<option value="New Zealand">New Zealand</option>
<option value="Nigeria">Nigeria</option>
<option value="Norway">Norway</option>
<option value="Oman">Oman</option>
<option value="Philippines">Philippines</option>
<option value="Poland">Poland</option>
<option value="Portugal">Portugal</option>
<option value="Qatar">Qatar</option>
<option value="Romania">Romania</option>
<option value="Russian Federation">Russian Federation</option>
<option value="Saudi Arabia">Saudi Arabia</option>
<option value="Serbia">Serbia</option>
<option value="Seychelles">Seychelles</option>
<option value="Singapore">Singapore</option>
<option value="Slovakia">Slovakia</option>
<option value="Slovenia">Slovenia</option>
<option value="Solomon Islands">Solomon Islands</option>
<option value="South Africa">South Africa</option>
<option value="Spain">Spain</option>
<option value="Sweden">Sweden</option>
<option value="Switzerland">Switzerland</option>
<option value="Tajikistan">Tajikistan</option>
<option value="Trinidad and Tobago">Trinidad and Tobago</option>
<option value="Tunisia">Tunisia</option>
<option value="Turkey">Turkey</option>
<option value="Uganda">Uganda</option>
<option value="Ukraine">Ukraine</option>
<option value="United Arab Emirates">United Arab Emirates</option>
<option value="United States">United States</option>
 
</select>
</div>
<div class="mc-field-group">
<label for="mce-WEBSITE">Website  <span class="asterisk">*</span><!--Anette: Her oversætter du tekst til "Website". -->
</label>
<input type="url" value="" name="WEBSITE" class="required url" id="mce-WEBSITE">
</div>
<div class="mc-field-group">
<label for="mce-COMMENT">Comments </label><!--Anette: Her oversætter du tekst til "Comments". -->
<input type="text" value="" name="COMMENT" class="" id="mce-COMMENT">
</div>
<div class="mc-field-group">
<label for="mce-HEARABOUT2">How did you hear about TEFCOLD? </label><!--Anette: Her oversætter du tekst til "How did you hear about TEFCOLD?", i <option> elementerne oversætter du mulighederne -->
<select name="HEARABOUT2" class="" id="mce-HEARABOUT2">
<option value=""></option>
<option value="Contacted by TEFCOLD employee">Contacted by TEFCOLD employee</option>
<option value="Found on internet">Found on internet</option>
<option value="Meet at fair">Meet at fair</option>
<option value="Newsletters">Newsletters</option>
<option value="Referred by my colleauge">Referred by my colleauge</option>
<option value="Referred by other customer">Referred by other customer</option>
<option value="SoMe">SoMe</option>
<option value="Other">Other</option>
 
</select>
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
<div class="response" id="subscribe-result"></div>
</div>    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
    <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_39276d5ae5ae654053ea39044_53d889e3c9" tabindex="-1" value=""></div>
    <div class="clear"><input type="submit" value="Submit" name="subscribe" id="mc-embedded-subscribe" class="button"></div><!--Anette: Her oversætter du tekst til subscribe knappen, du skal ændre teksten der er i "value" attributten -->
 
    </div>
</form>
</div>
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script><script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[11]='INTEREST';ftypes[11]='dropdown';fnames[8]='COMPANY';ftypes[8]='text';fnames[12]='FNAME';ftypes[12]='text';fnames[1]='LNAME';ftypes[1]='text';fnames[2]='PHONE';ftypes[2]='phone';fnames[4]='COUNTRY';ftypes[4]='dropdown';fnames[5]='WEBSITE';ftypes[5]='url';fnames[9]='COMMENT';ftypes[9]='text';fnames[10]='HEARABOUT2';ftypes[10]='dropdown';}(jQuery));var $mcj = jQuery.noConflict(true);</script>
<!--End mc_embed_signup-->
 
Nicolai Pedersen
Reply

Yeah - I am not sure we can fix that. Maybe move that code into a template and load that instead and change the field to a file selector.

 
Rasmus Thrane
Reply

Thank you for fast response Nicolai.

I will find a workaround.

 

You must be logged in to post in the forum