When viewing an order, I'm getting the notices below:

    Notice: Undefined index: path in template_preprocess_entity() (line 820 of /home/ampsound/public_html/sites/all/modules/entity/entity.module).
    Notice: Undefined index: path in template_preprocess_entity() (line 821 of /home/ampsound/public_html/sites/all/modules/entity/entity.module).
#21 1233226-21.commerce_payment_transaction_access.patch2.56 KBrszrama
PASSED: [[SimpleTest]]: [MySQL] 3,587 pass(es).
[ View ]
#12 order-1233226-12.patch694 bytesilluminatedgeek
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch order-1233226-12_0.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]


rszrama’s picture

Are you using a custom template or the Display Suite per #1206788: Undefined index in theme subsystem on view order page?

PI_Ron’s picture

Im using Display suite, and have a done suggestions in above issue.

brunorios1’s picture

same here...

. using garland theme
. not using display suite

amfis’s picture

Project:Entity API» Drupal Commerce
Version:7.x-1.0-beta10» 7.x-1.0-rc1
Component:Code - misc» Order
Priority:Major» Normal
Status:Needs review» Active

Any update?

same here
- using 'seven' theme for admin view (?q=admin/commerce/orders/1/view)
- the same using garland theme and looking into user orders (user/1/orders/1)
- not using display suite

Applied some "minor" fix to it.. dunno if it is proper one:
- added $uri['path'] checking

  else {
    // Else, try to automatically detect it.
    $uri = entity_uri($entity_type, $entity);
    $variables['url'] = $uri && isset($uri['path']) ? url($uri['path'], $uri['options']) : FALSE;
    if (isset($uri['path'])) {
      $variables['page'] = $uri && $uri['path'] == $_GET['q'];

Moved to Entity API because this is not Drupal Commerce issue.

amfis’s picture

Project:Drupal Commerce» Entity API
Version:7.x-1.0-rc1» 7.x-1.0-beta10
Component:Order» Code - misc
Priority:Normal» Major
Status:Active» Needs review
fago’s picture

Version:7.x-1.0-rc1» 7.x-1.x-dev
Priority:Normal» Major
Status:Active» Needs work

I don't see an issue with the code, as $uri['path'] needs to be there if an uri is returned. So I guess there is a wrong entity-uri implementation in commerce?

Also there is actually no patch, please follow patch creation docs.

amfis’s picture

Might be, because $uri['path'] for some elements is empty.

I've added additional if statement to check for existence. After doing this, everything works fine so far.

stopshinal’s picture

I'm also receiving the same errors on all of my order pages. It's first visible under default settings for the review order checkout page. I'm a bit of a newbie, how can I make this go away?

*edit , no display suit, a pretty much bare install

amfis’s picture

Well.. you can use quick hack for entity.module at line ~ 860 as mentioned in #4.

dcarr’s picture

#4 as a quick fix worked for me. Is that just a quick workaround, or will there be a patch available for this change?

amfis’s picture

Don't think so..

illuminatedgeek’s picture

Project:Drupal Commerce» Entity API
Component:Order» Code - misc
new694 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch order-1233226-12_0.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

I generated a patch based on the code above against the dev branch; it appears to fix the problem. Also since it patches the Entity API, I'm moving the issue back into that project.

fago’s picture

Project:Entity API» Drupal Commerce
Component:Code - misc» Order

As stated in #6, I think the code in the entity API is right. Please check commerce implementations.

Nikit’s picture

Priority:Major» Minor
Status:Needs work» Needs review

Enabling "Customer UI", submodule of Commerce, help me for this...

Status:Needs review» Needs work

The last submitted patch, order-1233226-12.patch, failed testing.

wesleydv’s picture

As mentioned in #14 enabling Customer UI also solved the problem for me.

amfis’s picture

It was enabled - "Customer UI" in my issue.

StryKaizer’s picture

Same issue here, Enabling Customer UI fixxed the issue

mr.baileys’s picture

Status:Needs work» Closed (duplicate)
Antoine_k’s picture

Version:7.x-1.x-dev» 7.x-1.3
Component:Order» Payment
Status:Closed (duplicate)» Needs review

If I may, I have coped with a similar problem for days...

My problem was connected to a view displaying Payments. It displayed exactly the same error messages.
After debugging, I found out that on commerce_payment_ui.module, on line 186, the test was wrong:

if (commerce_payment_transaction_access('view', $order, $transaction))

Indeed, the function commerce_payment_transaction_access needs respectively as arguments: the operation ('view' is right), the transaction (NOT THE $ORDER) and then the $user_account (facultative).

So I rewrote the line as follows (just remove "$order, "):

if (commerce_payment_transaction_access('view', $transaction))

And it works fine, I don't get any error message now!
It also fixes another error message "Undefined property $role".

rszrama’s picture

Title:Notice on Order view» Incorrect arguments sent to commerce_payment_transaction_access()
Version:7.x-1.3» 7.x-1.x-dev
Priority:Minor» Normal
new2.56 KB
PASSED: [[SimpleTest]]: [MySQL] 3,587 pass(es).
[ View ]

Great lead, Antoine_k. Upon further inspection, there were several places where we passed the wrong arguments to commerce_payment_transaction_access(), likely relics of the code before we added commerce_payment_transaction_order_access(). They didn't cause any tests to fail because the order entity had an order_id property just like the payment transaction entity, so it loaded and passed the generic order level access checks just fine.

Attaching a patch for test bot to confirm.

rszrama’s picture

Status:Needs review» Fixed

Accidentally committed / pushed this with another patch while I was coming back to check the test bot status. Fortunately all was well, so I committed a simply whitespace fix to note this in the changelog. :-/

Status:Fixed» Closed (fixed)

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

adam1’s picture

@ rszrama: Having the above issue using Omega-Theme, I would like to use your patch but I don't know, for which version of Drupal Commerce the patch is intended: for the last stable release or the dev-version?

aspilicious’s picture

Status:Closed (fixed)» Active

Using latest kickstart in combination with DS I still get these warnings on the confirmation step AND when a user looks at his orders:

Notice: Undefined index: path in template_preprocess_entity() (line 1020 of /data/sites/bram.peleman-industries-unibindshop.dev/www/sites/all/modules/contrib/entity/entity.module).
Notice: Undefined index: path in template_preprocess_entity() (line 1028 of /data/sites/bram.peleman-industries-unibindshop.dev/www/sites/all/modules/contrib/entity/entity.module).
Notice: Undefined index: path in template_preprocess_entity() (line 1020 of /data/sites/bram.peleman-industries-unibindshop.dev/www/sites/all/modules/contrib/entity/entity.module).
Notice: Undefined index: path in template_preprocess_entity() (line 1028 of /data/sites/bram.peleman-industries-unibindshop.dev/www/sites/all/modules/contrib/entity/entity.module).

rszrama’s picture

Status:Active» Closed (fixed)

This patch has been included in Commerce Kickstart 2.x, so it appears you have a separate issue. Go ahead and check the Kickstart queue to make sure it hasn't already been reported; if not, I'd open an issue in that queue, as perhaps it's just the Omega Kickstart theme missing some parameter. : ?

giorgio79’s picture

Using plain commerce, I am also getting #25
Notice: Undefined index: path in template_preprocess_entity() (line 1020 of entity/entity.module

PS: enabling commerce_customer_ui solved it for me as well :P

fewgoodmen’s picture

Version:7.x-1.x-dev» 7.x-1.5
Component:Payment» Views integration
Status:Closed (fixed)» Active

Error on /checkout/8/review page

Notice: Undefined index: path in template_preprocess_entity() (line 1020 of /home2/My Domain_name/public_html/carriconec/sites/all/modules/entity/entity.module).
Notice: Undefined index: path in template_preprocess_entity() (line 1028 of /home2/My Domain Name/public_html/carriconec/sites/all/modules/entity/entity.moduule)

I am getting the same problem could you tell me how to apply this patch
current version of Drupal being used: 7:20

rszrama’s picture

Version:7.x-1.5» 7.x-1.x-dev
Component:Views integration» Payment
Status:Active» Closed (fixed)

Your issue is different from this one, and since this was marked closed (fixed), that's an indicator that the patch for this issue has already been committed - as of October 2012, in fact. There's another open issue about path variables you can follow along through - but basically, I think it might just be an incorrect assumption in the Entity module.

FiNeX’s picture

I've the same error with Drupal Commerce and Customer UI enabled (I'm not using Kickstart):

Notice: Undefined index: path in template_preprocess_entity() (linea 1020 di /XXX/sites/all/modules/contrib/entity/entity.module).

P.S: Drupal 7.22, Entity API 7.x-1.0, Commerce 7.x-1.6.

fatfish’s picture

Same here.
I'm using costume lineItem