WebGUI
      Click here to register.
      
Sprechen Sie WebGUI? Parlez vous WebGUI? Se habla WebGUI? Spreekt u WebGUI?

Do you speak WebGUI? Please help us translate WebGUI into your language.



     Report a Bug > WebGUI Bug Tracker

Dataform renames field names after edit

User ekennedy
Date 5/4/2008 5:15 pm
Severity Minor (annoying, but not harmful)
Version WebGUI Stable 7.4.34-stable
Views 45
Rating 0    Rate [
|
]
Karma Rank 0.000000
Previous · Next
User Message
ekennedy

This error occurs in 7.4.30 stable and 7.4.34-stable (demo site).  After editing  a field on a dataform the field name is renamed (i.e.,  incremented it a  number, field, field1, field2, field3).  This is mainly a pain, however, it isn't right and if you happen to modify one of the critical mail related fields the mail feature will not work because the field is no longer named properly.  I believe this is the same error called out in:

http://www.plainblack.com/bugs/tracker/dataform-mail-broken-after-edit-email-fields#dtO6Wki6f6TAQfdyJLqiSg

I wonder if the fix to this bug:

http://www.plainblack.com/bugs/tracker/dataform-overwriting-fields#mqrWJWib4TM3EOYwDjPIJw

introduced the new problem.

 



Back to Top
Rate [
|
]
 
 
ekennedy

I looked at the code and I do believe it was broken in Revision 5741.  I think this fixes the problem:

*** DataForm.pm.orig    2008-05-06 20:49:45.000000000 -0400
--- DataForm.pm 2008-05-06 20:51:04.000000000 -0400
***************
*** 1071,1076 ****
--- 1071,1077 ----
      my $exists = 1;
      while ($exists) {
          $exists = $self->session->db->quickScalar('SELECT DataForm_fieldId FROM DataForm_field WHERE assetId=? AND name=?', [$self->getId, $name]);
+         if ($exists == $form->process("fid")) { last ; }
          if ($exists) {
              $name =~ s/(\d+|)$/$1 + 1/e; # increment number at the end of the name
          }

The change exits the field rename loop if the field with the same name is the same field that is being edited.  Let me know if you need me to commit the change.


Eric



Back to Top
Rate [
|
]
 
 
Graham

Fixed for 7.4.36.



Back to Top
Rate [
|
]