upload fields not consistent when editing productr

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
9 years 4 months ago #209397

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3

Hi,

There seems to be some bug in the editing of a product that's in an order. When the product is edited, the upladed files are not linked to the orderproduct anymore and there is a array field instead of the link to the file. See screenshot attached.


Attachments:

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 4 months ago #209413

Hi,

Could you please provide a screenshot of the settings of your custom field ?

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
9 years 4 months ago #209525

Sure, here it is.

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 4 months ago #209580

Hi,

Thanks for the report.

Please edit the file "administrator/components/com_hikashop/classes/order.php" and replace

	if(isset($productData['order_id'])) {
		$product = new stdClass();
		foreach($productData as $key => $value) {
			hikashop_secureField($key);
			$product->$key = $safeHtmlFilter->clean($value, 'string');
		}
By
	if(isset($productData['order_id'])) {
		$product = new stdClass();

		$fieldClass = hikashop_get('class.field');
		$oldData = null;
		$item_fields = $fieldClass->getData('backend', 'item');
		$fieldClass->_checkOneInput($item_fields, $productData, $product, 'item', $oldData);

		foreach($productData as $key => $value) {
			hikashop_secureField($key);
			if(isset($items_fields[$key]))
				continue;
			$product->$key = $safeHtmlFilter->clean($value, 'string');
		}
It should fix the issue by using the field class to save the custom fields in the order product.

I will submit the patch to the rest of the team (with other little modifications), which should be include in the next release.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum