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

Comments

eclipsegc’s picture

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.

tekad’s picture

Downgrading to webforms 6.x-2.3 did remove the errors. I am just hoping that downgraded properly.

Anonymous’s picture

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.

allanx’s picture

Category: bug » support

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

GreyHawk’s picture

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.

allanx’s picture

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!

mohammed j. razem’s picture

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) {

GreyHawk’s picture

Thanks, doublethink -- that just might be it. :)

allanx’s picture

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

design.er’s picture

Status: Active » Fixed

I tested it and it works absolutely fine!
Thanks a lot. You guys rock! :)
I think we can sign this as fixed.

GreyHawk’s picture

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. ;)

allanx’s picture

I've edited the code and this has fixed the error. Thanks.

alanburke’s picture

Status: Fixed » Reviewed & tested by the community

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.

summit’s picture

Subscribing, greetings, Martijn

adandos’s picture

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

jdwfly’s picture

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.

twirlingsky’s picture

subscribing

anawillem’s picture

Status: Reviewed & tested by the community » Fixed

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!

jdwfly’s picture

Status: Fixed » Needs review

We shouldn't marked fixed until the code maintainer adds this to the recent dev version.

joachim’s picture

Title: Enabling the module immediately results in all errors on all webforms. » error in webforms: 'Missing argument 3 for webform_associate_menu_access'
Category: support » bug
Status: Needs review » Needs work

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.

Anonymous’s picture

#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

jdwfly’s picture

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.

eclipsegc’s picture

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

jdwfly’s picture

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.

flyingyoda51’s picture

Good to see that maybe there is a solution on the horizon. Is there a solution available now???

tborrome’s picture

same issue...

marty.true’s picture

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

vindesh’s picture

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

vindesh’s picture

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

mohammed j. razem’s picture

See #7

shaisachs’s picture

Status: Needs work » Needs review
StatusFileSize
new775 bytes

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.

ycwjjjj’s picture

I follow the patch from #31, the error messages are still persisted.

jryanz’s picture

Patch from #31 doesn't work for me either

rickyd1’s picture

Patch from #31 did not fix the error

Dr Jay’s picture

+1

bryanhidalgo’s picture

Thanks it worked for me

eclipsegc’s picture

So, just as an update on this, webform 3.x will be able to perform this same functionality, which will make this module obsolete. I would encourage people to move to it as soon is they feel they're ready.

OnlineWD™’s picture

I just tried webform beta5 and it does not have webform associate functionality. Beta 5 allows individual webforms to be created for individual nodes but it does not allow 1 generic webform to be associated with a node type. I read the webform issues queue and they suggest referencing the webform using node reference which could be done with 2.X branch. Also the whole idea behind webform associate is that the email itself includes a link to the specific node where the form was submitted from, using node reference could not achieve this easily. For sure beta 5 does not make webform associate obsolete.

tekket’s picture

Patch from #31 seems to work for me. I use webform associate 6.x-1.0-beta2 and webform 2.9

rtdean93’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev

I have installed Webform 3.0 and am using the dev version of this module - and the errors continue. Any latest word?

I'm trying to create a ticketing system with Ubercart and would like to collect info (via a webform) and productize each webform.

Any ideas?

alhabshi3k’s picture

Hello every one.

I have done some patches ( though I see it is kind of hack ) on Webform_associate.module with fix two problems:
- Missing arguments (fixed), please test and confirm.
- Does not work with Webform 6.x-3.x (fixed).

However, now it work only with Webform 6.x-3.x but not backward compatible with Webform 6.x-2.x. So please upgrade your drupal's Webform module to 6.x-3.x.

Any dependent modules such uc_webform_productize, please report if not working.

Any modules that depend on webform 6.x-2.x and does not work with 6.x-3.0, can fixed by changing two functions names in dependent modules:

for Webform6.x-2.x webform_load() and webform_view();
for Webform6.x-3.x should be webform_node_load() and webform_node_view();

A better solution should be addressed within Webform6.x-3.x by providing a alias interface function.

eclipsegc’s picture

Assigned: Unassigned » eclipsegc
Status: Needs review » Closed (won't fix)

I worked with quicksketch on webform 3.x and this module is no longer needed. Webform 3.x does the work of this module out of the box now.