[Skip to main content](#vessel-content)

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

##

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

6 years 8 months ago [\#316421](#316421) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  *[Custom field "Ajax Image" not deleting it's content after save](/forum/22-market-bug-report/899319-custom-field-ajax-image-not-deleting-its-content-after-save#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 &quot;Ajax Image&quot;.  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 &quot;Ajax Image&quot; 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 &quot;Ajax Image&quot;  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")* was created by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")*

-- 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIyLW1hcmtldC1idWctcmVwb3J0Lzg5OTMxOS1jdXN0b20tZmllbGQtYWpheC1pbWFnZS1ub3QtZGVsZXRpbmctaXRzLWNvbnRlbnQtYWZ0ZXItc2F2ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

6 years 8 months ago [\#316443](#316443) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Custom field "Ajax Image" not deleting it's content after save](/forum/22-market-bug-report/899319-custom-field-ajax-image-not-deleting-its-content-after-save#316443 "-- 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 &quot;Ajax Image&quot;.  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 &quot;Ajax Image&quot; 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 &quot;Ajax Image&quot;  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")*

Hello,

Thanks for the report.

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

$category = $fieldsClass-&gt;getInput('category', $oldCategory);

By Code:

$category = $fieldsClass-&gt;getInput('category', $oldCategory, true, 'data', false, 'display:vendor_category_edit');

We will include that patch in the next release.

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIyLW1hcmtldC1idWctcmVwb3J0Lzg5OTMxOS1jdXN0b20tZmllbGQtYWpheC1pbWFnZS1ub3QtZGVsZXRpbmctaXRzLWNvbnRlbnQtYWZ0ZXItc2F2ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")**
- [![PeterChain's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar570.png)](/forum/user/570-peterchain "View PeterChain's Profile") Topic Author
- [ Offline](/forum/user/570-peterchain)

Less More

- Posts: 640
- Thank you received: 16
-
-

6 years 8 months ago [\#316457](#316457) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  Replied by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")* on topic *[Custom field "Ajax Image" not deleting it's content after save](/forum/22-market-bug-report/899319-custom-field-ajax-image-not-deleting-its-content-after-save#316457 "-- 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 &quot;Ajax Image&quot;.  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 &quot;Ajax Image&quot; 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 &quot;Ajax Image&quot;  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")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIyLW1hcmtldC1idWctcmVwb3J0Lzg5OTMxOS1jdXN0b20tZmllbGQtYWpheC1pbWFnZS1ub3QtZGVsZXRpbmctaXRzLWNvbnRlbnQtYWZ0ZXItc2F2ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

6 years 8 months ago [\#316485](#316485) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Custom field "Ajax Image" not deleting it's content after save](/forum/22-market-bug-report/899319-custom-field-ajax-image-not-deleting-its-content-after-save#316485 "-- 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 &quot;Ajax Image&quot;.  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 &quot;Ajax Image&quot; 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 &quot;Ajax Image&quot;  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")*

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" : Code:

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

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIyLW1hcmtldC1idWctcmVwb3J0Lzg5OTMxOS1jdXN0b20tZmllbGQtYWpheC1pbWFnZS1ub3QtZGVsZXRpbmctaXRzLWNvbnRlbnQtYWZ0ZXItc2F2ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.067 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
