AbanteCart Community

AbanteCart Development => Development Help Needed => Topic started by: starfish777 on November 10, 2017, 01:48:16 PM

Title: Media Resource Library Bug
Post by: starfish777 on November 10, 2017, 01:48:16 PM

I have been using the AbanteCart for a little over a week now. I am finding an issue with the Media Resource Library. It doesn't always work. I am finding that when I try to enter HTML resources is where I have the most trouble. I have had the same issue sometimes when adding images. However, after several attempts in a row, "once-in-a-blue-moon", it will work.

This was the case when trying to add the calendar icon as an HTML resource under the image type. For two days I persistently repeated the add function until for some unknown reason it just let me through. I cleared browser cached, all AbanteCart caches and logged out and logged back in and this doesn't seem to make any difference.

So, after successfully getting the HTML icon resource added by repeating the steps over and over again for 2 days. I decided to follow the instructions on this AbanteCart manual page for inserting a Youtube Video HTML resource in the "video" section. 

link--> abantecart.atlassian.net/wiki/spaces/AD/pages/8847367/Resource+Library#ResourceLibrary-AddImageswithHTMLasresource

Well, after repeating the steps to try to save it into the Resource library several times, it finally went in - but had to be removed due clicking on the resource to edit it and finding NOTHING inside of the resource. The message was "No resource can be found".  I decided to repeat the process today with the Firefox debugger on to see what message I would get and this is what I got:

(See Image Attachment #1)


The steps I take are these:

#1 - click on Catalog --> Media Resource Library
to open up the Library.
#2 - click on the + Media icon and Choose the Video icon as the resource type
Added the HTML snippet of code and gave it a name then clicked "Save"

The error came at this point and I was re-routed to a resource box that removed my resource and also said no resource could be found, when I closed that, I was re-routed to a page that "does not exist", and when I closed that I ended up on a Resource LIbrary box that shows some resources, but the input fields to the right missing.

(See Image Attachment #2)


(See Image Attachment #3)


(See Image Attachment #4)


Am I missing a step or something? I know this never seems to work at all when I try to add the Resource from the product level. I've tried that. The only time it seems to be successful on a lucky try is when I go through Catalog-->Media Resource Library to put the resource in.  Even then it is still a struggle to get it to do so.

Would be grateful for the help and insights and solutions.  It would be nice if this thing worked on the first try each time.

Title: Re: Media Resource Library Bug
Post by: Basara on November 13, 2017, 12:59:57 AM

I think your server block some requests thats why you see this. Check this article (https://abantecart.atlassian.net/wiki/spaces/AD/pages/3604484/Mod+security+403+406+error) and ask your hosting support to change security rules
Title: Re: Media Resource Library Bug
Post by: starfish777 on November 13, 2017, 09:22:55 PM
OK, thanks. I will give it a try and post any success.
Title: Re: Media Resource Library Bug
Post by: starfish777 on November 14, 2017, 09:49:53 PM
OK, Well I've tried implementing that mod_sec in my .Htaccess just for a while to trouble-shoot to see if that would do it. And I was still getting the same issue. So I called my hosting and found that I had not been using more up-to-date PHP version. Which I am NOW updated to PHP.7 and all of the rest of my requirements are now in place: MySQL --> 5.6, Curl enabled, GD php extension enable and ZIP php extension enabled and I am still having the same issue.  I went through just about all of the PHP extensions enabling them one at a time and testing and still getting the same issue. I need to ask.... Could setting AbanteCart up on HTTPS version of the domain be the problem?
Title: Re: Media Resource Library Bug
Post by: starfish777 on November 14, 2017, 11:21:31 PM
Latest update: 11/14/2017  at 10:49 EST

OK, I did some testing and went back to the AbanteCart demo (admin panel) and looked at how they input the video HTML resource. It seems they are using an old way of calling a youtube   video (using <object> and <embed>).

My AbanteCart will accept <object><embed> code (see image below) into the Video library but will NOT play nor display the video

However, my Abantecart will NOT accept the youtube <iFrame> code (see iframe image below), but DOES play it.

I've tested the iframe code in a "Content" page in abantecart and it displays and plays, but the library will not accept it.) Why is that?  Both <object> and <iframe> version are accepted in the AbanteCart Admin Demo. But mine only accepts the <object><embed> but won't play it. What could this be??? and more importantly, how do I get my Abantecart to accept the <iframe> html resource?  I don't think it is a security issue. I've upgraded my PHP to version 7.
Title: Re: Media Resource Library Bug
Post by: Basara on November 15, 2017, 12:29:17 AM
What could this be???

Hi, this could be something on your server.
Did you notice in manual that we are suggest to contact hosting to disable/edit mod_security?  Most of shared hosting do not allow user to edit this and your rules in htaccess maybe ignored.
Title: Re: Media Resource Library Bug
Post by: starfish777 on November 15, 2017, 01:52:00 AM

Yes, I saw the mention. I did speak to them but it was a no go. It's ok. I have found a way around it. You were right about the <iframe> being a security issue. I had realized that after much research today. (New to me...)

I will look for a different solution.

Thanks for your help.