Closed (fixed)
Project:
Rules Forms Support
Version:
7.x-1.0
Component:
Rules
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Feb 2017 at 09:02 UTC
Updated:
17 May 2018 at 13:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kris77 commentedI have the same problem too.
Everything worked well, but then suddenly appeared this mistake.
In admin/config/workflow/rules/forms in ACTIVE FORMS section, there is a blank checkbox.
I think that's the problem but do not know how to remove it.
Thanks.
Comment #3
nixar commentedI have the same issue.
Also like Kris77, I have an empty checkbox where there should be my second entityform.
Only the first one is listed correctly.
Comment #4
carrotandme commentedThe same error message on my website too. It suddenly appeared. Don't know why. So, I cannot reproduce...
If I uninstall Rules Forms Support module and re-install again, the error message disappeared. But, in few days, it appeared again while I developed my website...
Comment #5
socialnicheguru commented$options is an empty array.
Comment #6
markdcThis also just popped up for me. Had used the module without problems the last months. Was working on some other things and then this popped up. What do we all have in common? A certain config or conflicting module?
Comment #7
spelcheck commentedFor those of you currently experiencing this issue, please follow these steps to help debug. Note: devel module shouldn't be enabled long-term on production sites.
Install Devel module then navigate to /devel/php and enter this code.
Click and expand the "... (Array, # element)" bar, and then please copy and paste the result here. It should end up looking something like this:
Comment #8
spelcheck commentedAfter more research. this is leftover issues from: https://www.drupal.org/node/1447328.
The logic that would prevent this from happening again still needs to be built: https://www.drupal.org/node/1449936. I may try taking that on, but if anybody could still post result of the variable_get above, I'd still be curious to find out *why* it's happening.
Comment #9
markdcComment #10
nixar commentedThe result I got seems to confirm that this is caused by a malformed array variable:
Comment #11
spelcheck commentednixar, could you expand the unnamed (null) array between request_membership_renewal_entityform_edit_form and elements? fatmarker, it's been a few weeks but if you still have the issue, could you also expand the unnamed array in yours? One of the first elements should be keyed 'label' and will tell us which form was entered incorrectly.
Comment #12
spelcheck commentedI have a very minor patch on the way, but meantime this will remove the invalid rules_forms_form_info entries that are stored in the variable table and get things cleaned up before patching. I suggest doing a backup (because why not) and pasting this in /devel/php provided by the devel module to run this. TLDR, this will fix the error messages and the blank check boxes in Rules Form admin. @nixar before you do this, post that expanded null array please.
Note: devel module shouldn't be enabled long-term on production sites.
Comment #13
spelcheck commentedThis won't fix the error messages if you already have them, but should prevent them. The script I posted above will fix the error messages, and the empty check boxes in Rules Forms admin page.
Comment #14
kris77 commentedThanks @elizzle.
I have execute the code in #12 first and then apply the patch in #13.
it seems to work.
Thanks.
Comment #15
nixar commentedThe original output as posted:
With the expanded array:
The new unnamed array also contains the same array/unnamed array/element1/element2/element3...
Thanks for looking into this!
Comment #16
spelcheck commented@nixar very helpful! Good news is that by looking at it, the array structure is exactly what I was hoping to see, and what I was testing against. I'm more confident now that #12 then #13 will work for the long run.
The issue appears to be in rules_forms_after_build, populating $form_info by calling rules_forms_get_form_info with no parameter (or strangely, it being null), but at this point if simply checking for that returned NULL after making that call keeps it from happening again, I'm happy.
Comment #17
nixar commentedthanks again for your help with this one @elizzle!
Comment #18
maxplus commentedThanks, testing patch from #13
Comment #19
kris77 commented...The error appeared again
Comment #20
spelcheck commentedKris77 can you please run this in /devel/php and paste the results?
Comment #21
kris77 commentedThis is my output...
Tell me if I have to do more
Thanks @elizzle
Comment #22
danon1981 commentedWhen applying the patch #13 I get the following
And the error's keep showing.
If useful, this is my dsm output..
Thanks for looking into this @elizzle
Comment #23
spelcheck commented@danon1981, though it sounds like there is still work to be done on the patch, that patch from #13 should prevent the issue in the future but if you already have the issue, it won't correct it. In order to correct it, use the method in #12.
@Kris77, I'm looking into this, thank you for sending the output.
Comment #24
danon1981 commented@elizzle thanks! Sorry, I misunderstood #12
Comment #25
spelcheck commented@Kris77, I've tried all combinations of null, empty, and whitespace named array through the patched version and can't get it to set_variable with an empty array name. At very least we have a system for correcting the issue. Thanks for your help, but for now it's looking like we'll just have to treat the problem as it arises with the one-off script.
Comment #26
kris77 commentedOk @elizzle. I understand and thanks so much for your support.
Thanks thanks thanks
Comment #27
markdc@elizzle Sorry about my absence. For completeness' sake here's that expanded array:
I applied your code in #12 and the patch in #13. That unnamed array is gone, the error messages are gone, and I'm not anticipating to ever see that bug again. Well done!!!
Comment #28
socialnicheguru commentedI did this:
Then apply https://www.drupal.org/files/issues/rules_forms-2851050-1.patch
Comment #29
socialnicheguru commentedComment #30
spelcheck commentedI don't think 'Needs Review' is the right status, as the patch doesn't prevent the issue from arising, and the script is just a stop-gap. What the issue leads back to is #8:
More logic needs to be built into rules_forms_after_build() to validate and prevent the empty array key from being saved to variables in the first place.
Comment #31
HunterElliott commentedI'm also getting the error, but when I execute the PHP code the Arrays show 0 elements
Comment #32
raoofabdul commentedrules_forms_rules.inc @ line # 28, 32, and 36
variable $info['label'] is null thats why
how about if condition at line # 27 ?
Comment #33
shivenduray commentedHello Everyone,
I did this change in code and working fine with me. i creating patch file you can also apply this patch.
-Put patch files on root path
-Module location should be under sites/all/modules/
Thank's
Comment #34
kris77 commentedHi @shivenduray,
I ran the code in #12 first to delete the blank form, then I applied your patch and it seems to work.
Thanks @shivenduray.
Patch #33 work for me with Drupal 7.56 and Rules_Form_Support 7.x-1.0
Comment #35
markdcAfter running #12 script and applying #13 patch some months ago, the issue just recently returned. And as the first time, I couldn't pinpoint what triggered it — it seemingly came out of nowhere. I wasn't working with Rules or Forms Support.
I've again run #12 to remove the defective array, and this time patched with #33. So far, so good. But due to the nature of this issue, only time will tell if it's a working fix. If you don't hear from me again then it's still working.
Comment #36
caminadaf commentedPatch #33 contains 4 spaces indentation instead of 2 spaces, but the content seems valid. Since @fatmarker didn't come back I'm assuming that he didn't have any more problems with this.
Comment #37
caminadaf commentedCommited #33 with #13 and a few tweaks