Forums

Data not saving in plugin mode

gavinhanly 05 Jan, 2013
Hi - I've come up against a very strange problem. I've created this form:

http://www.hot-dinners.com/index.php?option=com_chronoforms&chronoform=gin

When I access the form directly, it saves all the data into the database no problem. However, when I access it via the plugin as on this page:

http://www.hot-dinners.com/Offers/Competitions/win-a-bottle-of-williams-gb-gin

- for some reason, none of the custom data is saving into the database. Can anyone think why this might be happening?
GreyHead 05 Jan, 2013
Hi gavinhanly,

Nothing obvious. The post data is being submitted correctly from the form in the plugin
dcce5d2e50f422cdc36d0b066...	1
input_checkbox_13	
input_checkbox_13	I have read and accept the Terms and Conditions
input_checkbox_3	
input_checkbox_4	
input_radio_7	
input_radio_7	Hereford Martini
input_submit_14	Submit
input_text_1	input_text_1
input_text_2	test@example.com


Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.

Note: if you are using the Easy Wizard you can turn on Debug on the Others tab.

Bob
gavinhanly 05 Jan, 2013
Hi - here's what the debugger said:
Data Array:

Array
(
    [option] => com_chronoforms
    [Itemid] => 302
    [id] => 88
    [lang] => en
    [layout] => blog
    [view] => category
    [chronoform] => gin
    [event] => submit
    [chronoform_data] => Array
        (
            [cf_uid] => da51c11b95e2399fc92c44ec9e70cbb8
            [cf_created] => 2013-01-05 15:30:36
            [cf_created_by] => 0
            [cf_ipaddress] => 93.96.136.70
            [cf_user_id] => 0
            [option] => com_chronoforms
            [Itemid] => 302
            [id] => 88
            [lang] => en
            [layout] => blog
            [view] => category
            [chronoform] => gin
            [event] => submit
            [cf_id] => 7962
        )

    [chronoform_data_cf_id] => 7962
    [redirect_url] => http://www.hot-dinners.com/Competitions/thanks-for-entering
)

Validation Errors:

Array
(
)

Debug Data

    redirect_url
        redirect_url_target_url: http://www.hot-dinners.com/Competitions/thanks-for-entering
        Redirect URL: http://www.hot-dinners.com/Competitions/thanks-for-entering
    redirect_user
        redirect_user_target_url: http://
        Redirect URL (click to continue):
        http://www.hot-dinners.com/Competitions/thanks-for-entering	



The weird thing is that it's saving the default data (time, ID, etc) but none of the form-specific data. Very odd.

Edit - here's what happens when I access the form directly - you can see the data coming through:

Array
(
    [option] => com_chronoforms
    [chronoform] => gin
    [event] => submit
    [Itemid] => 
    [input_radio_7] => Hereford Martini
    [input_text_1] => test
    [input_text_2] => test@test.com
    [input_checkbox_3] => Please sign me up to the Hot Dinners newsletter
    [input_checkbox_4] =>  Please keep me informed of news, offers and events from Chase
    [input_checkbox_13] => I have read and accept the Terms and Conditions
    [input_submit_14] => Submit
    [c85c6e03ba19919735e0c18612e007d0] => 1
    [chronoform_data] => Array
        (
            [cf_uid] => f12cc5a534214c17b2068fb2fd1d9323
            [cf_created] => 2013-01-05 15:33:36
            [cf_created_by] => 0
            [cf_ipaddress] => 93.96.136.70
            [cf_user_id] => 0
            [option] => com_chronoforms
            [chronoform] => gin
            [event] => submit
            [Itemid] => 
            [input_radio_7] => Hereford Martini
            [input_text_1] => test
            [input_text_2] => test@test.com
            [input_checkbox_3] => Please sign me up to the Hot Dinners newsletter
            [input_checkbox_4] =>  Please keep me informed of news, offers and events from Chase
            [input_checkbox_13] => I have read and accept the Terms and Conditions
            [input_submit_14] => Submit
            [c85c6e03ba19919735e0c18612e007d0] => 1
            [cf_id] => 7963
        )

    [chronoform_data_cf_id] => 7963
    [redirect_url] => http://www.hot-dinners.com/Competitions/thanks-for-entering
)

Validation Errors:

Array
(
)

Debug Data

    redirect_url
        redirect_url_target_url: http://www.hot-dinners.com/Competitions/thanks-for-entering
        Redirect URL: http://www.hot-dinners.com/Competitions/thanks-for-entering
    redirect_user
        redirect_user_target_url: http://
        Redirect URL (click to continue):
        http://www.hot-dinners.com/Competitions/thanks-for-entering
GreyHead 05 Jan, 2013
Hi gavinhanly,

It looks like there is some kind of HTML redirection going on and all that you end up with is the 'get' data from the page URL - the 'post' data is being lost in transit.

Bob
gavinhanly 05 Jan, 2013
Yes - I did have a redirect on those pages - so my "on submit" event has:

DB Save
ReDirect URL
Redirect User

Because I wanted to send the users to a confirmation page (it refirects to a "thanks" article). Will that not work on the live site, as it seems to work OK when the form is accessed directly?
GreyHead 05 Jan, 2013
Hi Gavinhanly,

The redirect in ChronoForms isn't the problem; it's happening before ChronoForms sees the data. Do you have anything set up to redirect the site URLs - from hot-dinners.com to <!-- w --><a class="postlink" href="http://www.hot-dinners.com">www.hot-dinners.com</a><!-- w --> for example???

Bob
gavinhanly 05 Jan, 2013
Hi - I've gog SH404SEF in place - could that be causing the problem?

I've put this in the URL redirect field: http://www.hot-dinners.com/Competitions/thanks-for-entering

Which doesn't appear to be redirecting - but I'm not sure.

The form works OK if I don't redirect - but ideally I wanted to take the user to a confirmation page, rather than back to the competition page. Is there another way to achieve this?
GreyHead 05 Jan, 2013
Hi gavinhanly,

Please set SH404SEF to ignore ChornoForms URLs.

The redirection in the form should have no affect on the data saving.

Bob
This topic is locked and no more replies can be posted.