Hi!
I came across to something I believe is a bug.
When I installed and activated the module, I got warnings about commerce_order_reference_entity_view & flag_entity_view & rules_entity_view (commerce, flags and rules modules installed)

Diggin through the code I discovered the:

module_invoke_all('entity_view',$submission, 'webform_submission_entity');

This causes every entity to execute hook_entity_view giving that error. I replaced the code above with:

module_invoke('webform','entity_view',$submission, 'webform_submission_entity');
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

msti’s picture

this is the patch

threewestwinds’s picture

Steps to reproduce: Activate both webform_entity and rules on the same site, then view a form submission. You'll get a message that both the 3rd and 4th arguments are missing.

The attached patch is not correct - it invokes only webform's hook_entity_view implementation (which doesn't exist) - ie, it renders the line ineffective.

Properly, the line should be changed to
module_invoke_all('entity_view',$submission, 'webform_submission_entity', 'full', LANGUAGE_UNDEFINED)
That is, add the missing arguments ($view_mode and $langcode). I believe LANGUAGE_UNDEFINED is correct here, since webform submissions are not translatable.

threewestwinds’s picture

Status: Active » Needs review

So, I didn't attach a patch file, but it's a simple, one line change.

mstrelan’s picture

Patch in #1 resolves an error I got with metatag module. Adjusting to #2 doesn't work because LANGUAGE_UNDEFINED should be LANGUAGE_NONE. New patch attached.

klaasvw’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #4 fixed the issue for me.

wodenx’s picture

Likewise, #4 fixes the issue for me.

lolcode’s picture

Issue summary: View changes

Agreed, #4 fixes the issue for me.

donutdan4114’s picture

#4 Patch works.

Tim Asplin’s picture

Attached new patch, line numbers seam to have changed.

Also added space after the first comma in the function call arguments as well.

Regards

AaronBauman’s picture

Title: module_invoke_all » Webform Entity's invocation of hook_entity_view missing 2 paramaters

RTBC++

one-liner. let's get it in

joelstein’s picture

Works for me!

  • Tim Asplin authored f1c5be7 on 7.x-1.x
    Issue #1857084 by msti, Tim Asplin, mstrelan:  invocation of...
AaronBauman’s picture

Status: Reviewed & tested by the community » Fixed

committed

amaisano’s picture

Do you have a copy paste of an error example? Trying to determine if this is what I am getting, but I didn't see an example of an on screen error. Thanks.

AaronBauman’s picture

I don't think this would have triggered any php error, notice or otherwise.
If you're seeing an error, it's probably a different issue.

amaisano’s picture

Ok, thanks. Going to switch to the latest dev anyway. Appreciate today's commits!

Status: Fixed » Closed (fixed)

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