- πΊπΈUnited States TomTech
Automatically closed because Drupal 7 security and bugfix support has ended β as of 5 January 2025. If the issue verifiably applies β to later versions, please reopen with details and update the version.
We need to delete orders on certain conditions with "Delete entity" rule. For example, when removing a product from cart. Unfortunately, when deleting an order with "Delete entity" rule it gives an error:
Notice: Trying to get property of non-object in commerce_license_commerce_order_update() (line 410 of /home/username/public_html/sites/all/modules/commerce_license/commerce_license.module). =>
The Rules' log show the rule "Charge a recurring order" is failing:
0 ms Reacting on event After updating an existing commerce order.
0.068 ms Evaluating conditions of rule Charge a recurring order. [edit]
0.42 ms Unable to get a data value. Error: Invalid data value given. Be sure it matches the required data type and format. Value at commerce_order(): .
0.606 ms Unable to evaluate condition data_is. [edit]
0.614 ms AND evaluated to FALSE.
0.619 ms Finished reacting on event After updating an existing commerce order.
which unfortunately always trigger AFTER our custom rule to delete the order entity even though we assigned the heaviest weight 10 in its settings.
I am not sure how to troubleshoot this further, but the line 410 looks like:
if ($order->status != $order->original->status && $order->status == 'canceled') {
foreach ($licenses as $license) {
$license->revoke();
}
}
and I believe it does not take into account cases when orders get completely deleted and not only change their status.
Closed: outdated
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed because Drupal 7 security and bugfix support has ended β as of 5 January 2025. If the issue verifiably applies β to later versions, please reopen with details and update the version.