$element is modified after onBeforeOrderDelete

  • Posts: 8
  • Thank you received: 0
12 years 2 weeks ago #74839

Hello,

I am using the latest Hikashop (2.0) and I just stumbled on a problem with the onBeforeOrderDelete and onAfterOrderDelete plugin callbacks.

The $element array containing the keys of the deleted order is modified by the helper class between the before and the after callback. This array is passed by reference in the subfunctions and is modified by it causing changes of content in the before and after callback. Check the following lines:

com_hikashop/classes/order.php (hikashopOrderClass->delete) line 682: $result=parent::delete($elements);
com_hikashop/helper/helper.php (hikashopClass->delete) line 1281: $elements[$key] = $this->database->Quote($val);

In this last line, the $element which is passed by reference is modified by the database->quote() function, which is adding single quotes around the order key in the array. So after returning from the helper->delete(function) the $element array is passed to the onAfterOrderDelete callback, but this time, the order keys have quotes around it.

-Tom.

Last edit: 12 years 2 weeks ago by tommytom.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 2 weeks ago #74873

Hi,


Thank you for the report. We've changed that on our end so that the elements in the $elements passed to onAfterOrderDelete are not quoted.

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 0
12 years 2 weeks ago #74874

Great !
When will that be available ?
-T

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 2 weeks ago #74875

It has already been fixed on our end.
Please redownload HikaShop on our website and update it on yours and it will work.

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum