Closed (fixed)
Project:
Webform Computed Component
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Oct 2011 at 10:23 UTC
Updated:
4 Jan 2012 at 16:30 UTC
Jump to comment: Most recent file
I get the following error
Notice: Undefined index: cid in webform_computed_allow() (line 729 of [installpath]/sites/all/modules/webform_computed/webform_computed.module).
As many times as the number of webform fields already defined.
I believe its because the $component['cid'] on that line. When I chance it to $cid the errors disappear. As far as I can tell the $component array does not contain a 'cid' key. Unfortunately I don't totally understand that bit of code. So I don't know what consequences changing this has (except for making the errors disappear.) Nor can I provide a patch to fix it.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | removing-notices-1302316-3.patch | 840 bytes | pedrofaria |
Comments
Comment #1
vernond commentedSorry for the delay - my day job has been getting in the way of my after-hours interests...
I've not thought of a prettier/better way to code that function as yet. It is true that there should not be irritating PHP notice messages, but they'll be there until I can find a better way to handle the scenarios that cause the function to be executed. By changing the code as you have, you will run into the scenario where Component A can be used as a factor to compute Component A (i.e. itself) which could lead to unpredictable results.
If your concern is that the notices are appearing on your production site displays, then it is recommended that you disable this by selecting None under Configuration -> Logging and errors -> Error messages to display.
Comment #2
firfin commentedI haven't run into that scenario yet, thanks for te heads up!
But you are saying that the messages don't do any harm? Everything is working according to plan? In that case this is a minor issue.
I will put this to postponed then?
Hopefully you'll have the time some day, thanks for a very handy module anyways!
Comment #3
pedrofaria commentedMy patch to remove php notices.
thanks!
Comment #4
vernond commentedThanks @pedrofaria, I'm going to be spending some time on this module again over the next few days (at last) and will test your suggestions.
Comment #5
vernond commentedPatch committed to both 7.x-3.x and 6.x-3.x branches