Closed (cannot reproduce)
Project:
Webform
Version:
7.x-4.0-alpha6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
9 Aug 2012 at 04:31 UTC
Updated:
25 Nov 2018 at 22:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedCould anyone look at this, i reported this in alpha 4 and its still here in alpha 6 currently the error is saying on line 2893
Comment #2
quicksketchThanks for the report. I haven't been able to confirm this problem which is why it hasn't been addressed. Could you provide steps to reproduce the problem? Does this happen on new webform nodes, or only a certain Webform in particular?
Comment #3
Tobias Jonch commentedI would consider this of major priority as well (mainly because I get it too ;-)
I can't provide an exact way to replicate, but for me it deals with certain pages of the same webform.
At first I got an error like this; Undefined index: submitted in webform_client_form_validate()
(looks like there's another issue for this)
I figured I'd try deleting the components on that page and create them again, but then I got the error reported here.
Hope it helps you help me! ;-)
Otherwise a truly great module!!
Comment #4
quicksketchThanks Tobias, that makes a start but I still have no idea how to reproduce this problem. Sounds like it *is* specific to one particular Webform in your case, which means there's probably some set of steps you have to do to get the Webform into that state where it starts causing trouble. I'd like to look into this problem, but I can't fix it if I can't see it.
Comment #5
Tobias Jonch commentedCan I somehow export the webform I've made, share it with you?
Would it help to see the webpage itself?
It's for a customer, so I don't want to make the url public - but I don't see any harm in sending it to just you.
Also, I have found that once I have ticked a choice on the page in question (answer required), then go to the next page and back again, the error isn't there. hm. I guess it only validates the form going forward.
-Tobias
PS: I should mention that I'm back to my original error msg:
Notice: Undefined index: submitted in webform_client_form_validate() (line 2510 of ..... webform/webform.module).
Comment #6
quicksketchYou can export the node with Node Export module and send me the export. That would be more helpful to me than seeing your site, as I'll be able to debug it locally.
Comment #7
arodier74 commentedThanks for this module, it is great to use, and powerful enough for most of the cases.
However, I have the same error, and I think it's major as well. Here the modification I have made in my environment to fix the error:
Beside that, I think that 4k lines of code in the same file is a little bit too much, and some code should be factorised in many sub files.
Comment #8
Anonymous (not verified) commentedHi please see attached zip it contains my node export file where i get the error
Comment #9
Anonymous (not verified) commentedany update?
Comment #10
GCP commentedWe're also getting this error. We're using a new module called Webform View, and when I disabled that module, the error stopped. Since others without Webform View are getting this error, I thought it would be more helpful here than in that module's queue, and might help in reproducing it. I'm attaching a Node Export of the webform, in case it's helpful.
Comment #11
dazweeja commentedAlso seeing this error and can't reproduce consistently.
However, the error message has no index (after the ':') so it looks to me like $cid is undefined, which means that 'webform_get_cid($node, $form_key, $parent);' on the previous line did not return a value. I don't know under what circumstances webform_get_cid() does not return a value (I suspect it's related to the $parent parameter), but to use the result of a function that doesn't necessarily return a value as an array index looks to me like fragile code.
Comment #12
strae commentedHi all, im using a different version (7.x-3.18) of this module, but i noticed this problem if I try to move elements from a fieldset to another.
In my module_form_[FORMID]_alter() i have something like:
The validation works good, but I always get this error:
Notice: Undefined index: in webform_submission_data() (line 26 of /sites/all/modules/webform/includes/webform.submissions.inc).But if i move the actions element:
The error is different:
Notice: Undefined index: in _webform_client_form_submit_flatten() (line 2607 of /sites/all/modules/webform/webform.module).and the form doesnt get validated (never submitted).
in line 2607 of /sites/all/modules/webform/webform.module i tryed to check the $cid:
but obviously doesnt work.
Looks like in my case the problem is caused by moving elements; Am I doing it in the wrong way, or is a bug?Solved:
i was moving elements in the wrong way. Now im using $form['#pre_render'], and the problem is solved.
Comment #13
quicksketchI finally got around to working with @nathan6137's form. Upon importing, I received several messages of this sort:
The problem with undefined indexes is likely caused by these modules modifying the layout of the Webform. Other than the notices thrown because these component types were missing, I encountered no other notices like the ones described here.
So again, it doesn't look like Webform is responsible here. Although we could supress the errors by doing an isset() check, the errors *should* be thrown, because there is something wrong with the provided structure. The module causing the incorrect structure should remedy the problem.
Comment #14
darksnowI'm getting the same issue and in my case I think it's down to me messing with form elements in code. I assume this means they don't get a CID for some reason.
The flatten function just creates an array of form element values indexed by the CID
If there's no CID then there's nothing to put the value against so nothing should appear in that array. For my use case that's fine though I appreciate that this could be an issue for some.
The patch I've attached is simple defensive programming which checks that we have a $cid before using it. It's nothing more than an IF statement round the whole thing. I think it should be committed anyway since defensive programming is just good practice.
Cheers.
Martin.
Comment #15
danchadwick commentedClosing as this looks like a damaged / modified webform. I'm not a fan of adding lots of defensive programming against damaged data structures that should never be damaged. It leads to unbounded code bloat.