When updating to ctools 1.4 I receive the following errors:

    Warning: Missing argument 3 for commerce_entity_access() in commerce_entity_access() (line 973 of /home/user/public_html/sites/all/modules/contrib/commerce/commerce.module).
    Warning: Missing argument 4 for commerce_entity_access() in commerce_entity_access() (line 973 of /home/user/public_html/sites/all/modules/contrib/commerce/commerce.module).
    Notice: Undefined variable: entity_type in commerce_entity_access() (line 977 of /home/user/public_html/sites/all/modules/contrib/commerce/commerce.module).

The errors are displayed on the product display (node). I'm thinking it is directly related to panels templates... Just disabled the panel template for my display node and the errors went away.

UPDATE: a fix should come in Ctools via this issue: #2195729: Warning: Missing argument 4 for entity_metadata_taxonomy_access() in entity_metadata_taxonomy_access()

Comments

philsward’s picture

Issue summary: View changes
philsward’s picture

Issue summary: View changes
philsward’s picture

Issue summary: View changes
m.lebedev’s picture

I have the same problem.

rszrama’s picture

Title: Ctools 1.4 Errors » Incompatibility with Ctools 1.4 / Panels
Version: 7.x-1.8 » 7.x-1.x-dev
Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

I'm gonna need more info; I don't personally use Commerce with Panels, so I haven't seen these errors, but since this is owing to some change in Ctools, it'd be nice to know how it's calling commerce_entity_access() and why it isn't passing in that third argument (the $entity_type, which is pretty essential after all).

philsward’s picture

Yeah, just tried to reproduce from a sandbox fresh install and... nothing. *sigh* I'll post back if I come up with something of use.

philsward’s picture

Ah, posted too soon... Figured out "when" it's appearing...

To recreate, do the usual stuff like install commerce, panels, ctools etc.

- Enable the ctools Node template page manager and create a variant for the product display nodes. Don't worry about adding any content.

- To get the error, add a "Relationship" for Commerce Product from Node (on Node: Product Reference [field_product_reference]) from the Contexts section.

- When viewing a display node, you'll receive the errors.

So, it has to do with the relationships... Now to figure out why I'm using the relationship in the first place on the site in question...

Hope that helps @rszrama! That's pretty much the extent of my troubleshooting abilities :-/

Ravenight’s picture

Same problem here.

I am using the relationship from the display node to the commerce_product so I can pass the commerce_product ID through to a reaction rule when the product display panel variant is displayed.

I am getting three errors:

  • Warning: Missing argument 3 for commerce_entity_access() in commerce_entity_access() (line 973 of /var/www/sites/all/modules/commerce/commerce.module).
  • Warning: Missing argument 4 for commerce_entity_access() in commerce_entity_access() (line 973 of /var/www/sites/all/modules/commerce/commerce.module).
  • Notice: Undefined variable: entity_type in commerce_entity_access() (line 977 of /var/www/sites/all/modules/commerce/commerce.module).
forestgardener’s picture

I do not have drupal commerce installed and have received a similar message since the ctools update to 7x1.4 posted here: https://drupal.org/node/2195729
As Ravenight has pointed out on 2195729 this could be a result of contextual relationships.
I wanted to make rszrama aware that this is not a commerce specific issue.

philsward’s picture

Thanks for pointing this out @forestgardener

rszrama’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks for the update, Craig. When I grepped the Ctools 1.4 source, it looked like that relationship could be to blame. I didn't diff it against 1.3 to see what it was doing before, but perhaps it just wasn't performing an access control check before at all (which is why no one saw the error).

I suppose we can leave this issue open here so people see it and end up at the related issue. I'll update the original post to make the link a little more prominent.

davidwhthomas’s picture

It looks like this is caused by the second stanza in this ctools commit: http://drupalcode.org/project/ctools.git/commitdiff/5438b40

ctools isn't passing the $account and $entity_type to the access callback.

I made a patch that fixes the issue and posted it here:

https://drupal.org/comment/8488289#comment-8488289

Cheers.

Ravenight’s picture

Status: Active » Reviewed & tested by the community

@davidwhthomas is correct. The patch that is posted there fixes this issue. Marking this as RTBC

davidwhthomas’s picture

Thanks Ravenight, could you please review my patch on https://drupal.org/node/2195211

here: https://drupal.org/comment/8489489#comment-8489489

It's that issue that will need to be marked RTBC for the commit.

Cheers,
David

Ravenight’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

@davidwhthomas, done and done.
I am going to mark this issue as closed (duplicate) to direct people over to the primary issue.

Thanks for all the help!

rszrama’s picture

Thanks for updating this for me. : )