When I delete an order from my orders list, I get this error:

Notice: Undefined index: path in redirect_delete_by_entity_path() (line 802 of [path redacted]/sites/all/modules/redirect/redirect.module).

The delete still goes through.

Comments

rszrama’s picture

Status: Active » Closed (won't fix)

Looks like a problem with the Redirect module to me. Perhaps it ought to be checking for a path instead of assuming the entity is going to return a valid URI. In our case, I'm betting that it's not returning one because there is no view access for deleted orders. : ?

You might try posting a support request in that queue. Perhaps there's a way to ignore the Order entity in the Redirect module?

vasike’s picture

Status: Closed (won't fix) » Active

it seems we're back with this issue here #1349212-5: Deleting an order from Drupal Commerce erases all redirects
they say there that it's a Commerce issue with the uri callback

what else i can say: that i get this error for deleting products within a rule

mr.baileys’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Closed (duplicate)

This is actually a Commerce bug in that, strictly speaking, an URI callback is not allowed to return FALSE or NULL, and instead always has to return a valid array with a 'path' key/value. Commerce does return NULL/FALSE in a number of uri callbacks, including commerce_order_uri().

Marking this issue as a duplicate of #1392654: Commerce can return invalid return values for uri callbacks..

tmsimont’s picture

Status: Closed (duplicate) » Active

I'm pretty sure things have changed in the Entity API and this fix should now originate in the redirect module. I made a comment in the supposed duplicate issue: http://drupal.org/node/1392654#comment-7344176

I'm marking this as active again because I'm fairly certain that with the change in the API this error now is the redirect module's responsibility.

I could be wrong.. if so... sorry! just close it again.

dave reid’s picture

Status: Active » Fixed

Redirect has already been fixed to account for a NULL/FALSE value:

function redirect_delete_by_entity_path($entity_type, $entity) {
  if ($uri = entity_uri($entity_type, $entity)) {
    redirect_delete_by_path($uri['path']);
  }
...
rszrama’s picture

Status: Fixed » Closed (fixed)
tmsimont’s picture

I got this error even though that code is present... I had to add another line to make it go away:


function redirect_delete_by_entity_path($entity_type, $entity) {
  if ($uri = entity_uri($entity_type, $entity)) {
    if (isset($uri['path'])) {
      redirect_delete_by_path($uri['path']);
    }
  }
....

I'm honestly not sure why that was the case -- somehow $uri was getting set but not $uri['path'] i guess... i do have some unusual checkout configurations (http://drupal.org/sandbox/tmsimont/1891426) so I guess it could be related with other things i'm doing.

dave reid’s picture

Returning an empty $uri['path'] is not a valid result from the function, so if that's still an issue it needs to be fixed upstream.

tmsimont’s picture

yep. my bad