Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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');
Comment | File | Size | Author |
---|---|---|---|
#9 | webform_enttiy_module_invoke_all_1857084_9.patch | 668 bytes | Tim Asplin |
#4 | 1857084-4-module_invoke-all.patch | 667 bytes | mstrelan |
#1 | module_invoke_all-1857084.patch | 650 bytes | msti |
Comments
Comment #1
mstithis is the patch
Comment #2
threewestwinds CreditAttribution: threewestwinds commentedSteps 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.
Comment #3
threewestwinds CreditAttribution: threewestwinds commentedSo, I didn't attach a patch file, but it's a simple, one line change.
Comment #4
mstrelan CreditAttribution: mstrelan commentedPatch in #1 resolves an error I got with metatag module. Adjusting to #2 doesn't work because
LANGUAGE_UNDEFINED
should beLANGUAGE_NONE
. New patch attached.Comment #5
klaasvw CreditAttribution: klaasvw commentedThe patch in #4 fixed the issue for me.
Comment #6
wodenx CreditAttribution: wodenx commentedLikewise, #4 fixes the issue for me.
Comment #7
lolcode CreditAttribution: lolcode commentedAgreed, #4 fixes the issue for me.
Comment #8
donutdan4114 CreditAttribution: donutdan4114 commented#4 Patch works.
Comment #9
Tim Asplin CreditAttribution: Tim Asplin commentedAttached new patch, line numbers seam to have changed.
Also added space after the first comma in the function call arguments as well.
Regards
Comment #10
AaronBaumanRTBC++
one-liner. let's get it in
Comment #11
joelstein CreditAttribution: joelstein commentedWorks for me!
Comment #13
AaronBaumancommitted
Comment #14
amaisano CreditAttribution: amaisano commentedDo 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.
Comment #15
AaronBaumanI 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.
Comment #16
amaisano CreditAttribution: amaisano commentedOk, thanks. Going to switch to the latest dev anyway. Appreciate today's commits!