Forums

Inserting data with "/" automatically adds \ to the entry on save data

webbusteruk 05 Oct, 2020
When a field's data containing "/" is submitted through a form and saved using Save Data on CCv6, the resulting entry in the database contains \ within the data. How do we stop this behaviour?

Eg user submits a form with field data "this/that", which is then saved into the database as "this\/that". When retrieved from the database, it returns the data as "this\/that" which does not correspond to user's entry.

Seems to happen if the field data is saved as an array (ie dropdown multiselect) but not when it's saved as a text input or single dropdown.
Max_admin 06 Oct, 2020
do you have the latest CF6 update installed ?
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
webbusteruk 06 Oct, 2020
Yes, chronoform is on version 6.1.4.

However this is using Chronoconnectivity 6.
webbusteruk 07 Oct, 2020
Example debug. Code field is a dropdown with multi-select on:
Array
(
    [save_data] => Array
        (
            [data] => Array
                (
                    [code] => Array
                        (
                            [0] => C/D
                        )

                )

            [_success] => Data saved successfully
            [log] => Array
                (
                    [0] => INSERT INTO `table` (`code`)  values  ('["C\/D"]');
                )

            [var] => Array
                (
                    [code] => ["C\/D"]
                )

        )

)
Max_admin 03 Nov, 2020
when the data is returned in JSON format it has the slashes, but what happens when you JSON decode it ?
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
You need to login to be able to post a reply.