Cannot get round form feedback

Author Message

Claire M

Monday 25 February 2008 7:50:32 am

Hi

I'm quite new to eZpublish but still find it hard to believe how much I'm struggling to make a simple feedback form working.
I simply want a textarea to receive visitor question and would like the content to be either sent by email or collected.

However, I couldn't make it happen.

First, I used eZ publish basics book, from Halasy and tried to follow it step by step.
Then, when clicking on submit I am simply redirected to the same page, nothing happens.
I don't use the same folder, instead of the root the feedback object is in a subfolder of my content, but as I changed the override accordingly (and so far it's working as I'm in the right template when trying to submit)
I was wondering about "content/action" as the target of post, I cannot find a template named like this in my design/standard/template/content folder, neither in my site's template folder which doesn't even has a content folder.
So I am missing this file and is that the reason for the troubles? If so, where can I find it?

Secondly, I used the tuto at http://ez.no/developer/articles/how_to_create_ez_publish_forms which was quite nice, but in the end it's not collecting information either because in the back-end it said no object collected information so far.

I even tried to use a simple form plain html and just <form action={"/form/process"|ezurl} method="post">. In this one it is said to enable the module in the setting, which I did, but doesn't seem to work better.

I saw quite a lot of posts here talking about issues on feedback form so it doesn't seem so easy finally, but I'm not far from giving up now, after trying those three solutions I cannot see anything more to try.
Does anyone has any clues about what I can be missing?

Vicente Olivan

Monday 25 February 2008 10:51:25 am

Hi Claire;

See this:
http://ez.no/developer/articles/how_to_create_ez_publish_forms
http://serwatka.net/en/blog/ez_publish_3_8_new_custom_edit_handler

Grettings

Yudi Setiawan

Tuesday 26 February 2008 6:57:00 pm

Hi everybody,

I'm a newbie in eZ Publish and now working on developing an eZ Publish site for my company.
I have tried the tutorial (http://ez.no/developer/articles/how_to_create_ez_publish_forms).
Have posted a comment to the article asking this question and Peter Keung advised me ask the forum.
Then I found this thread.

Basically, the result I got is the same like Claire.
Just want to add some observation :
When click the Send button, it will just display the form (and the data we filled in) again.
I noticed that the URL displayed in the browser is just "<eZRoot>/<siteacces>/content/action".
And when I checked on the backend admin (Setup - Collected Information), it shows nothing.

I have tested the standard form (Contact) and it works.
After pressed the Send button, it will goes to URL such as : "<eZRoot>/<siteacces>/content/collectedinfo/<number>" and also it shows in the Collected Information.

Please help.
Thank you.

Claire M

Wednesday 27 February 2008 4:12:04 am

I finally made it work, using a default form that is referenced in this topic
http://ez.no/developer/forum/setup_design/problem_with_contact_form/re_problem_with_contact_form__4

The form code is in http://zev.ez.no/svn/extensions/ezwebin/trunk/packages/ezwebin_extension/ezextension/ezwebin/design/ezwebin/override/templates/full/feedback_form.tpl

{* Feedback form - Full view *}

<div class="border-box">
<div class="border-tl"><div class="border-tr"><div class="border-tc"></div></div></div>
<div class="border-ml"><div class="border-mr"><div class="border-mc float-break">

<div class="content-view-full">
    <div class="class-feedback-form">

        <div class="attribute-header">
            <h1>{$node.name|wash()}</h1>
        </div>

        {include name=Validation uri='design:content/collectedinfo_validation.tpl'
                 class='message-warning'
                 validation=$validation collection_attributes=$collection_attributes}

        <div class="attribute-short">
                {attribute_view_gui attribute=$node.data_map.description}
        </div>
        <form method="post" action={"content/action"|ezurl}>

        <h4>{$node.data_map.sender_name.contentclass_attribute.name}</h4>
        <div class="attribute-sender-name">
                {attribute_view_gui attribute=$node.data_map.sender_name}
        </div>

        <h4>{$node.data_map.email.contentclass_attribute.name}</h4>
        <div class="attribute-email">
                {attribute_view_gui attribute=$node.data_map.email}
        </div>

        <h4>{$node.data_map.subject.contentclass_attribute.name}</h4>
        <div class="attribute-subject">
                {attribute_view_gui attribute=$node.data_map.subject}
        </div>

        <h4>{$node.data_map.message.contentclass_attribute.name}</h4>
        <div class="attribute-message">
                {attribute_view_gui attribute=$node.data_map.message}
        </div>

        <div class="content-action">
            <input type="submit" class="defaultbutton" name="ActionCollectInformation" value="{"Send form"|i18n("design/ezwebin/full/feedback_form")}" />
            <input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
            <input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
            <input type="hidden" name="ViewMode" value="full" />
        </div>
        </form>

    </div>
</div>

</div></div></div>
<div class="border-bl"><div class="border-br"><div class="border-bc"></div></div></div>
</div>

So I changed the blocks

 <h4>{$node.data_map.subject.contentclass_attribute.name}</h4>
        <div class="attribute-subject">
                {attribute_view_gui attribute=$node.data_map.subject}
        </div>

to display the properties of my own object and my css classes, but nothing else, and it worked.
Now I can see the data in the admin panel, setup/information collection/name_of_my_instance -> click on the link under "number of collections"

I couldn't really figure out the difference between my previous code and this one but I have to say as it was working I didn't try to hard ;)

Another thing that happened was that I had changed an attribute of the class AFTER having instantiated my form, I also made a few template changes and I was getting the same behaviour you are talking about. So I can't swear the change in the class was the reason, but when I put my old class back it just worked again...

Hope this is helpfull to you Yudi

Vicente it was kind of you to try to help but to send me the link I said I used as a model seems like you're not really reading, don't you think? ;)

Norbert Wagner

Wednesday 07 October 2009 7:24:37 am

Hi,
this still seems to be an issue, I had similar problems.
In fact modifying the content class after having created the object introduced this behavior for me.
Simply deleting and recreating the object solved my problem though.

Hope that helps others,

best regards,
Norbert

Paul Wilson

Thursday 11 February 2010 3:24:36 am

[POSSIBLE SOLUTION]
Hi,

I'm pretty sure this problem occurs when a form template does not include all the information collector attributes for the object class. (I've done a simple test and both reproduced and then removed the problem).

For example, assume the form object class contains the attributes "your name" and "your email", both tagged as "information collectors". If the fcustom orm template does not actually generate a value for one (or both) of these attributes, then I suspect the form-submit process fails, leading to the problem outlined in the posts above (i.e. the same form just reloads again, although the URL is changed to a /content/action one).This would also explain why the problem might not be identifiable from the template code examples above.

Therefore, I suggest the following:

- Review your custom class definition (eg "My Custom Form" class) via the admin interface / setup tab, carefully noting all the information collectors

- Make sure your form template actually contains those information collectors (watch out for typo's).

I suspect this is a tricky problem to spot because the PHP scripts called by the content/action don't actually return an error message when the expected attributes are missing. Perhaps this is shown in a log file somewhere - I've not checked fully.

Hope that helps.

-Paul

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.