Path

ez projects / ezsurvey_ezp4 / forum / general / editing with ie brings dupl... / re: editing with ie brings...


Editing with IE brings duplicated fields

You need to be logged in to post messages in the forums. New users may register here.

Xavier Gouley

Member since:
08 February 2008

Posts: 13

Wednesday 08 October 2008 3:55:06 pm

Hi,

Have you ever seen this problem ?

When I use firefox, all is well, but with IE :

When I save/publish a content with an eZsurvey datatype, with one simple text question, the text question is duplicated.
Trying to remove it works well, but when I publish again, the text question is always duplicated. Modifying and publishing the content X times will duplicate X² times the text question !!!

With Firefox, I can remove duplicated questions, all is right...

But my customer wants to use only IE... an idea for this ?

Thanx !
Up

Bjørn Reiten

Member since:
22 February 2008

Posts: 39

Wednesday 08 October 2008 11:21:16 pm

Hi Xavier,

This problem is mentioned in other threads here as well, but I have not been able to reproduce the problem myself yet.

Any information so I can reproduce it fully would be great. Are you using IE 6 or 7? any special version or setup? Does it happening with all question types, or only the text question?
Up

Xavier Gouley

Member since:
08 February 2008

Posts: 13

Friday 10 October 2008 3:09:37 pm

I must find this bug ASAP for my customer, so I made deeper tests :

Under IE 6 (not tested with others), this occurs not only for text question type, but in fact with the last question of the survey...

What I've done :
- With Firefox, create a content with a Survey, with two questions (text and mail destination types). All is right here.
- With IE6, in the admin interface, modify this content, and simply click on "Store draft" at the end of the form... The last question is duplicated when the interface refreshes.


I have a serious idea of the problem :
- Add the following line to /kernel/content/edit.php, before all PHP code :



 var_dump($_POST);



- I know it's ugly... But with this, I compared POST data when I click on the "Store Draft" button, between Firefox and IE... POST data are different !
- In this POST, I have one more field for IE that is not posted by Firefox :



["CustomActionButton"]=>


 array(2) {


   ["34883_ezsurvey_question_copy_290"]=>


   string(44) "<IMG src="/design/standard/images/copy.gif">"


   ["34883_ezsurvey_question_copy_291"]=>


   string(44) "<IMG src="/design/standard/images/copy.gif">"


 }




- Hum, this data seems to be from the copy button on the right of each question... You used a <button> tag, which I disapprove because it react differently between each browser...

I will comment the copy button to see if it's the problem, and tell you ASAP what is the result.

Up

Xavier Gouley

Member since:
08 February 2008

Posts: 13

Friday 10 October 2008 3:29:44 pm

Yep, the copy button is the problem...
Even if you don't click on it, IE sends the data in the POST, and the question is duplicated when you publish or when you store the draft.

Can you reproduce it now ?

the button is in the survey/design/standard/templates/content/datatype/edit/ folder,
on the ezsurvey.tpl file, at line 236.

I comment the button, all is fine with IE...

I suggest you replace all <button> tags in your templates, by clean <input type="submit"> buttons, even it is harder for the look...

Up

Bjørn Reiten

Member since:
22 February 2008

Posts: 39

Friday 10 October 2008 3:42:20 pm

Yes, great! We got it reproduced here now as well, and looks like IE6 is handling the button tag differently (works fine in IE7).

This should fix the problem and still make it look the same.




Index: design/standard/templates/content/datatype/edit/ezsurvey.tpl


===================================================================


--- design/standard/templates/content/datatype/edit/ezsurvey.tpl       (revision 250)


+++ design/standard/templates/content/datatype/edit/ezsurvey.tpl       (working copy)


@@ -230,7 +230,7 @@


    <th class="tight">


    <label><input type="checkbox" name="{$prefixAttribute}_ezsurvey_question_visible_{$:item.id}_{$attributeID}"{section show=$:item.visible|eq(1)} checked="checked"{/section} /> {"Visible"|i18n('survey')}</label>


    </th>


-   <th class="tight"><button type="submit" name="CustomActionButton[{$attributeID}_ezsurvey_question_copy_{$:item.id}]" value=""><img src={"copy.gif"|ezimage()} /></button></th>


+   <th class="tight"><input type="image" name="CustomActionButton[{$attributeID}_ezsurvey_question_copy_{$:item.id}]" value="" src={"copy.gif"|ezimage()} /></th>


    <th class="tight"><input type="text" size="2" name="{$prefixAttribute}_ezsurvey_question_tab_order_{$:item.id}_{$attributeID}" value="{$:item.tab_order}" /></th>


 </tr>


 <tr>


 



Up

Bjørn Reiten

Member since:
22 February 2008

Posts: 39

Friday 10 October 2008 4:01:30 pm

The changes should now be available in the svn version of eZ Survey. Updated in rev. 56 and 57.
Up

You need to be logged in to post messages in the forums. New users may register here.