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.

CommentFileSizeAuthor
#3 removing-notices-1302316-3.patch840 bytespedrofaria

Comments

vernond’s picture

Sorry 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.

firfin’s picture

Priority: Normal » Minor
Status: Active » Postponed

I 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!

pedrofaria’s picture

Status: Postponed » Needs review
StatusFileSize
new840 bytes

My patch to remove php notices.

thanks!

vernond’s picture

Thanks @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.

vernond’s picture

Status: Needs review » Fixed

Patch committed to both 7.x-3.x and 6.x-3.x branches

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.