Closed (fixed)
Project:
Webform Classes
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Jul 2012 at 16:04 UTC
Updated:
20 May 2013 at 15:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
Luke Harrison commentedPatch attached.
Comment #2
carlhinton commentedThis has been fixed in the 7.x-1.0 stable version.
Comment #3
vlad.dancerThis is not fixed in the 7.x-1.0 stable version. First of all, code from patch didn't commited to the project. Second how it could be fixed if comment #2 posted on July 25, 2012 at 10:41am but version 1.0 posted on 2012-Jun-28. Please update this issue!
Comment #4
bluemuse commentedI can confim I also just received the same error message upon installing. Note it's not a clean instal. I am using the conditionals version of webform, as well as webform validation.
Comment #5
vlad.dancerCarlHinton, please update situation!
Comment #6
carajito commentedHi, I have the same issue
With webform 7.x-4.0-alpha6
Comment #7
skaughtthis issue still exists.
Comment #8
sonicthoughts commentedsame error in v1 but patch seems to resolve. pls commit.
Comment #9
aaronott commentedThe original patch supplied doesn't solve the root issue or possibly caused a new issue.
In a fresh install I noticed that this issue is still a problem so it doesn't appear that the module has been patched. After applying the patch in #1, the error message does indeed go away however I noticed that my classes were now disappearing. Looking into the issue I found that the classes were being overwritten by '' (blank). Going back to the component and re-adding the class would fix the issue temporarily until I needed to move a field around.
Steps to reproduce:
1) Apply patch in #1
2) Add two components
3) assign a class to the component
4) re-order the components
5) edit a component to see that the class definition has now been blanked
Root Cause:
hook_webform_component_update is called when the component is updated (works) but is also called on each element when the ordering of the fields are altered (causes error).
When the full webform is 'Save'd the class parameters have a different name than when a component itself is saved.
Component Submit:
Webform Save:
Notice when the component is saved there is a $component['classes']['classes'] array assigned and when the webform is saved the same field is defined as $component['class'].
There are two ways to fix this error, either fix the discrepancy between the two submits, or check for the $component['op']. I haven't had much time to look through the rest of the module and fix the discrepancy so I've implemented the second option in the attached patch. I think it would be a good idea to fix the root cause (discrepancy) to reduce confusion going forward.
Comment #10
aaronott commentedProbably should check to see if $component['op'] exists to prevent other errors.
Comment #11
carlhinton commentedPlease use the 7.x-2.0 stable version.
Comment #12
carlhinton commented