error in webforms: 'Missing argument 3 for webform_associate_menu_access'
tekad - January 13, 2009 - 17:13
| Project: | Webform Associate |
| Version: | 6.x-1.0-beta2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Description
This module is throwing errors on all webforms. I tried to install the module and immediately started seeing the following error repeated over and over above the form. I tried to create a new webform and the same thing is happening.
warning: Missing argument 3 for webform_associate_menu_access() in /var/www/vhosts/officefurniturelocators.com/httpdocs/sites/all/modules/webform_associate/webform_associate.module on line 48.
Drupal 6.8
Webform 6.x-2.4
Webform Associate 6.x-1.0-beta2

#1
there are general issues with webform 2.4 as I understand it. stick with 2.3 right now, and let me know if the errors persist. I'll take a look at it shortly if so.
#2
Downgrading to webforms 6.x-2.3 did remove the errors. I am just hoping that downgraded properly.
#3
Any idea when this will be fixed? I just upgraded to Webform 6.x-2.6 and I'm getting errors. I'm going to downgrade back to 6.x-2.3.
Thanks.
#4
Any news on a fix for this issue...?
Same message here:
warning: Missing argument 3 for webform_associate_menu_access() in /home/example/public_html/new/sites/all/modules/webform_associate/webform_associate.module on line 48.
This is line 48 in that ,module file:
function webform_associate_menu_access($func, $arguments = array(), $node, $a3 = NULL) {
Anyone got answers?
Love to use this module for my clients...
Drupal 6.2
Webform Associate 6.x-1.0-beta2
cheers
allanx
#5
Nevermind -- just tested and looked at the full code; $a3 is a valid value. I have not idea.
This is impacting a site I just set up where Ubercart requires webform associate, and also a site that a friend set up.
The line that you print looks a little off to me -- I wonder if the missing argument 3 is $a(3), which would make the line look like this:
function webform_associate_menu_access($func, $arguments = array(), $node, $a(3) = NULL) {
I've not done any Drupal development and am not sure if the possible "fix" would be just to find and replace the original line with the one above, but from my ancient programming background the $a(3) would be the "missing" argument 3.
#6
Thanks GreyHawk,
Tried your suggestion but:
Parse error: syntax error, unexpected '(', expecting ')' in /home/erisj/public_html/new/sites/all/modules/webform_associate/webform_associate.module on line 48
Poo!
#7
Argument 3 is the $node argument. I just added = NULL to the $node argument, in line 48 in webform_associate.module.
Seems working well so far!
function webform_associate_menu_access($func, $arguments = array(), $node = NULL, $a3 = NULL) {#8
Thanks, doublethink -- that just might be it. :)
#9
Cool and thanks for the efforts of all...!
So, am I right in assuming that this will fix the error message, and make the associate module work? Did it work for you GreyHawk?
allanx
#10
I tested it and it works absolutely fine!
Thanks a lot. You guys rock! :)
I think we can sign this as fixed.
#11
AllanX -- testing it in the morning, but suspect that it will work beautifully...the results so far look like they've all been positive, so I'm pretty confident going in. :)
I'll let you know for sure once I've tested. ;)
#12
I've edited the code and this has fixed the error. Thanks.
#13
Hi all
[I'm in the process of reviewing this module]
The issue would appear to need a fix in the code, that your guys have found.
However it shouldn't be marked as 'fixed' until the maintainer adds that code to the CVS repo.
It is then marked as fixed by the maintainer.
Great work guys!
Alan
PS I know there's no patch... but it's pretty close.
#14
Subscribing, greetings, Martijn
#15
don't think that is the correct solution...
Webforms will receive content and see if it has any related forms to load up. You're telling it that content is null aren't you ???
here's what i did...
http://drupal.org/node/426818
#16
That fix from #7 does eliminate the error. I tried it on the recent dev version.
Although I am having trouble looking at the submissions... I get an access denied for my webform submissions. I might end up posting an issue about it.
#17
subscribing
#18
just speaking to EclipseGc - who was so kind and rigorous and awsome. if ever you see him on #drupal or anywhere else, you should bow to him with reverence as you would to a holy man. He gave the following code:
http://drupalbin.com/9676
this works using the .dev modules for both webform_associate and uc_webform_productize.
THANKS EclipseGc!
#19
We shouldn't marked fixed until the code maintainer adds this to the recent dev version.
#20
Just changing the issue title to something more specific -- I nearly filed a duplicate :)
And I don't think this fix is correct:
$node = menu_get_object('webform_associate_webform');
The above line causes the 'Configuration Form components' subtabs to disappear -- I just see the default subtab, so in effect I can't add form components.
#21
#7 works for me just like everyone esle BUT, when i go to the "Form components" edit page of the associated node I get the follow error:
warning: Invalid argument supplied for foreach() in /home/kitsap/public_html/home/sites/all/modules/webform/webform_components.inc on line 31.Any ideas on how to correct this? Thanks
#22
Sorry guys, I'd help you out but I decided against using this module. There were too many bugs that just aren't getting fixed.
#23
So the fundamental problem here is that webform wasn't meant to be abused like this. It COULD be tweaked to work (ultimately) but I think we have a better solution. Check out #510256: Allow webforms on any content type and get on the band wagon there. This will get the functionality of webform_associate directly into webform 3.x It's already working better than webform_associate is.
Eclipse
#24
I don't believe I was abusing this module, but rather just trying to use it normally. If you are really abandoning this module you might want to put an update on the project page stating that you are no longer fixing bugs in lieu of your other implementation.
I glanced at your other issue and it sounds like a good implementation. I'll have to actually check out how well it works.
#25
Good to see that maybe there is a solution on the horizon. Is there a solution available now???
#26
same issue...
#27
Ok, so we are in the last week of October 2009... any word on this module being fixed?
The only remedy offered is to degrade to Webforms 2.3, well they are now at 2.8 so if this module is not compatible with Webforms, it simply doesn't work at all, right?
And the blurb about "abusing" the module... really? How do you abuse a module? If it works, you use it... I fail to see how it's possible to "abuse" a module.
Looks like this module is abandoned by the author and as it was said by jdwfly, you may want to put some sort of announcement to that affect...
#28
In function webform_associate_menu_access() put "$node=NULL" Then problem will be resolve.
I have try this and my problem resolved.
Try this :)
function webform_associate_menu_access($func, $arguments = array(), $node=NULL, $a3 = NULL)
Regard's
Vindesh Lowanshi
#29
In function webform_associate_menu_access() put "$node=NULL" Then problem will be resolve.
I have try this and my problem resolved.
Try this :) put
$node=NULL
in function webform_associate_menu_access
function webform_associate_menu_access($func, $arguments = array(), $node=NULL, $a3 = NULL)
Regard's
Vindesh Mohariya
#30
See #7
#31
I don't think the "$node=null" fix is a good one. It eliminates the error message, true, but it's not correct because it does not actually provide the correct access arguments to Drupal, and therefore you are liable to get problems when you try to review webform submissions.
The issue is just that webform_associate tries to override the webform menu items (which is not abuse - that is why Drupal 6 has the awesome menu_alter hook), and replaces the access callback for those menu items with a webform_associate callback. When it does so, it also modifies the access arguments appropriately. That is fine and dandy, except that webform_associate only anticipates three possible access callbacks: node_access, user_access, and webform_submission_access. However the latest version of webform uses a fourth access callback, webform_results_access. Since webform_associate does not anticipate this access callback, it does not alter the access arguments appropriately, resulting in the errors we've been discussing here.
The correct solution is to patch webform_associate so that it anticipates webform_results_access and modifies arguments appropriately. That is what the attached patch does, and as far as I can tell it both suppresses the error messages and provides the Drupal menu system with the arguments needed to prevent unauthorized access to webform result submissions.