String copying problem in latest CC/CF

peter49 12 Jun, 2009
Hi,

in the latest CC version an {edit_record} results in calling a CF form and storing the record fields in the corresponding input fields for editing.
When a record field contains double quotes, this isn't working properly, the first double quote effectively works as end-of-string. Inputting double quotes in forms has never been a problem.
Is a patch possible to correct this?

------- Added later
When the same form is called from the back-end (Show Data + edit) it's the single quote that causes problems. When one of the fields contains a single quote, the whole forms remains empty. Single quotes cause problems when input as well: they seem to serve as end-of string.

Regards,
Peter
GreyHead 13 Jun, 2009
Hi Peter,

I've left a note for Max to look at this.

Bob
peter49 19 Jun, 2009
Hi Max,

yes, I know you have been busy doing other things recently, but I urgently ask you to take some time for the problems raised in this thread. The implementation of the usage of forms for editing connection records really contains some errors.
Let's start with the front-end editing using the {edit_record} construct. Some of the fields in records on my site do contain double quotes. When I allow a user to edit such a record, the following appears (obtaind by displaying the source of the page - only one element shown, being a somewhat restyled example, clearly showing the problem):

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width:122px;">Choir</label>
    <input class="cf_inputbox required" maxlength="150" size="30"
           id="text_1" name="choir_name" value="Men's choir "Full Scale"" type="text" title=""
           style="width:410px;"/>
  </div>
  <div class="cfclear"> </div>
</div>

in case the name of the choir is `Men's choir "Full Scale" `. Clearly no attention is given to properly escaping the double quotes with problematic consequences.
The problem with back-end editing (via Admin settings) is in the same area, but now it is about single quotes. Editing in the back-end has been implemented differently. Now a function is attached to the 'domready' event that assigns the values to the input fields. For the same choir I see the following lines:

$('ChronoContact_change_choir').getInputByName1('cf_user_id').setValue('62', '');
$('ChronoContact_change_choir').getInputByName1('choir_name').setValue('Men's choir "Full Scale"', '');
$('ChronoContact_change_choir').getInputByName1('choir_director').setValue('Mr. D. Rector', '');

No attention for properly escaping the single quote with absolutely dramatic consequences.
And finally, even when no quotes at all are used still the resulting page contains errors. Probably as a result of this pressing the submit button does not restore any changed values. Via a quick scan through the page code I found (changed the layout a bit for reading purposes, but not a bit of content changed!)

<input type="hidden" name="1cf1" value="7ea2697c9cd6f97da48ff4c151115d26" />
</form>
<!-- You are not allowed to remove or edit the following 3 lines anyway if you didnt buy a license --> 
<div class="chronoform">
<a href="http://www.chronoengine.com">Powered By ChronoForms - ChronoEngine.com</a>
</div>
<!-- You are not allowed to remove or edit the above 3 lines anyway if you didnt buy a license -->	

</form>
<div class="clr"></div>
</div>
<div class="b">
  <div class="b">
    <div class="b"></div>
  </div>
</div>
</div>

Of course this is only a code snippet, but as far as I can see the generated <form> and </form> elements do not match. And neither do the <div> and </div> elements.
Whatever the case, the back-end editing just doesn't work.
Please correct!

Regards,
Peter
Max_admin 21 Jun, 2009
Hi Peter,

Thanks for reporting this, for the admin, I have solved the single quotes problem and a string with both single or double quotes now is working fine!

same for frontend editing too! indeed this was a problem with Chronoforms data loading and the profile plugin!

a new release of Chronoforms will be out soon with these fixes, if you like you can contact me anytime today (as I'm planning to release it tomorrow or at Tuesday) to get the latest files and test everything!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
peter49 21 Jun, 2009
Hi Max,

I'm happy to read that at least this problem has been solved. Please send for testing; you know how to reach me...

Regards,
Peter
Max_admin 21 Jun, 2009
Hi Peter,

that at least this problem



is there any others ?🙂

you know how to reach me



maybe but maybe I forgot because I answer too many emails everyday, could you please reply in an old email or start a new one through the contact us page so I can send you the installer ?

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.