Custom field "Ajax Image" not deleting it's content after save

  • Posts: 634
  • Thank you received: 16
4 years 1 month ago #316421

-- HikaShop version -- : 4.2.3
-- HikaMarket version -- : 3.0.3
-- Joomla version -- : 3.9.15
-- PHP version -- : 7.1.12

Hi,

We have configured a custom field for the table category to use the field type "Ajax Image".


The upload of the image works fine.

But when clicking the delete button and applying changes, the image persists, it doesn't get deleted.

Reproducing the same delete action via Hikashop in the backend works fine.

I have tried the same with a custom field "Ajax Image" in the table product and the same problem happens.


Steps to reproduce the problem:

1. Edit a category with a custom field of the type "Ajax Image"

2. Upload an image

3. Save the changes

4. Return to edit the same category

5. Delete the image inside the custom field

6. Save the changes

7. When entering again in the category, the image has not been deleted.



I have tried it again in a fresh joomla site with protostar and without any customization to get the same effect.



--
Víctor

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
4 years 1 month ago #316443

Hello,

Thanks for the report.

Please edit the file "administrator/components/com_hikamarket/classes/category.php" and replace the line

$category = $fieldsClass->getInput('category', $oldCategory);
By
$category = $fieldsClass->getInput('category', $oldCategory, true, 'data', false, 'display:vendor_category_edit');
We will include that patch 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.

  • Posts: 634
  • Thank you received: 16
4 years 1 month ago #316457

Hi again,

I have made the changes, but the problem persists.

When I delete the image and click on "Apply" or "Save" it seems like the form is rejecting the save and returns to the form without any message of success or failure of the save.

Thanks.

--
Víctor

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
4 years 1 month ago #316485

Hello,

The rest is an issue in HikaShop front-end upload "image_entry" view.
If you compare with the same "image_view" but in the backend, you will see that there is more code to handle the "delete" :

if(!empty($this->params->delete) && !empty($this->params->uploader_id)) {
	$p = '';
	if(!empty($this->params->field_name))
		$p = ',\'' . $this->params->field_name . '\'';
?>
	<a href="#delete" class="deleteImg" onclick="return window.hkUploaderList['<?php echo $this->params->uploader_id; ?>'].delImage(this<?php echo $p;?>);" title="<?php echo JText::_('HIKA_DELETE'); ?>"><i class="fa fa-times"></i></a>
<?php
}

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.

Moderators: Obsidev
Time to create page: 0.057 seconds
Powered by Kunena Forum