Jump to content

Poduct images problem


KevS

Recommended Posts

Hi

I've just upgraded to cubecart 6.1.9 and I'm having a problem with adding product images.  Its running on php5.5.38

I can add a new product no problem, but when I go to the images tab, the image selection box comes up with 'loading'  and it just hangs there and doesn't display the image folders.

If I then drop an image file into the upload box, it uploads OK and then the other box displays the image folders with the uploaded file. 

If I then select an image and save it, it adds the image to the product.

If I then edit the product image again, same problem with the 'loading', but if I upload another image and select that, it says 'no product changes were made' and the original image remains.

The images tab in the file manager seams to work OK and I can upload there with no problem.

Last resort, would it be possible to revert back to the previous version? I have some backups but no sure how to restore them without breking everything.

Anyone have any ideas?

Kev

Not sure if this is relevant or not but if I click the digital tab, I get the same issue with 'loading'

Edited by KevS
Link to comment
Share on other sites

How many products do you have in your store? It may be that you are running out of memory or javascript is crashing if you have a lot.

Also there is a newer version 6.1.12 available with a security update so if possible consider an upgrade to that.

Edited by ayz1
Link to comment
Share on other sites

It could be the case that the new version has a slightly modified version of the javascript file that powers the product's Image Picker box, but has the same filename.

In these cases, your browser has no idea that the file has changed and is using its internally cached copy.

So, try forcing your browser to reload all the page resources. This is usually done with CTRL-F5.

Edited by bsmither
Link to comment
Share on other sites

Thanks for the replies.

There are only around 50 products in the store, so I don't think it's that.

I have upgraded to 6.1.12, but it's still the same.

Using CTRL-F5 (a few times) does seam to get the image folders and files to load properly and I can then add an image.  But the existing product image boxes all show as unchecked and when the page refreshes the added image box is also unchecked even though the image has been added and is there in the store. 

Any more ideas?

Link to comment
Share on other sites

I've checked the image/source and sub folders and there are only images in those folders.

I created the ini-custom.inc.php file in the main directory.  There was already an error_log file there with this error (repeated around 100 times):

PHP Warning:  Invalid argument supplied for foreach() in /home/directp/public_html/cube/admin_mlnPWQ/sources/maintenance.index.inc.php on line 850

I think this may come from when I used the rebuild in the maintenance section (after the problem started to appear).  No other error messages though.

I had a look at the databases and when I add or remove an image, it does update the Cubecart_filemanager database and also the Cubecart.image.index database.  So at least it is writing to the databases.

I tried installing a new clean site in a different location on the same server and that has the same problem with the 'loading' hanging up on the product image picker box.  But it is also eventually cleared with CTRL-F5's and when the images are added it remembers them fot that product.

Any other ideas would be most appreciated?
 

 

 

 

Edited by KevS
Link to comment
Share on other sites

Most modern browsers have a Diagnostic Suite. In Firefox, it was Firebug and is now the built-in Web Developer's Tools. Chrome has one, and Internet Explorer has something called F12 (I think).

Anyway, please use this tool to view the Network activity. This panel will show you what the browser sends out and shows what the server sent back. For Firebug, you will need to enable 'Persist'.

After the admin Add/Edit Product page loads, CubeCart will make two AJAX requests: for a list of images and a list of files. Depending on the Network tool you use, the line may say XHR (you may be able to filter for those lines), or simply show the URL as something like:
admin.php?_g=xml&type=files&q=list&dir=%2F&group=1&product_id=1&cat_id=

Look for those requests and what gets sent back, if anything.

Edited by bsmither
Link to comment
Share on other sites

Thanks very much for that.

When I edit a product there are 2 GET xhr lines (both look the same) and both have status 500 errors.

https://........./cube/admin_GNA7H1.php?_g=xml&type=files&q=list&dir=%2F&group=2&product_id=10&cat_id=

https://......../cube/admin_GNA7H1.php?_g=xml&type=files&q=list&dir=%2F&group=2&product_id=10&cat_id=

The params query string has this in it:

_g xml
type files
q list
dir /
group 1
product_id 14
cat_id

In the JS tab at the bottom is says ..... Empty string passed to getElementById()

There doesn't seam to be a cat_id number in any of these, but I'm not sure whether there should be?  Maybe not because the product images relate to the product and nothing to do with the caterory.

Once again any help would be appreciated.

 

Edited by KevS
Link to comment
Share on other sites

In this case, a cat_id is not necessary.

A 500-ISE suggests that PHP is crashing. The Warning you posted would not cause a 500-ISE.

Allow me to suggest a closer look at the error_log. Or, make sure that the error_log is in fact getting new entries appended onto it.

There is a remote chance that the crash is happening before PHP gets involved. If so, see if there is a web server error log. See if there may be something unusual in the .htaccess file.

 

It is strange that you say both are 'group=2'. One of them should be 'group=1'.

Even so, this strangeness won't cause a 500-ISE.

Link to comment
Share on other sites

You're right, there was a group 1 and a group 2, so they were not the same as i said.

An interesting point, if I set up a new cubecart instalation on the same domain, or even a sub domian of that domain,then I get the same problem.  However, if I install it on a different domain it all works absolutely fine.  So could the problem be with my hosting and not cubcart?  I've checked the php version and options and altered the ones to be the same as the domain that works fine, but that doesn't help.

Link to comment
Share on other sites

I have no idea what the actual cause is, but (even though you attempted to obscure the links above) when I visit your main site, I get a Kurouto skin, followed by a standard Authentication Required lockout. Visiting the /cube/ sub-folder, I get nothing but the lockout.

It seems the Homepage document has two images that are forced to be loaded from the /cube/ subdirectory.

As an experiment, temporarily remove the basic authorization needed to access the /cube/ sub-folder.

 

Link to comment
Share on other sites

Thanks.

I tried that but to no avail. 

I spoke to my hosting company last night (EUKhost.com) but to be honest they weren't much help.  I've been with them the biggest part of 10 years and their tech support used to be top notch, lately not so good.  I had a problem with sending emails on another site after they updated their server and it took ages for them to sort it out.  They insisted it was nothing to do with the server, even though the problem started the same day as the server update after running fine for 10 years!  I am beginning to wonder if I shouldjust bite the bullet and go somewhere else?  Can anybody recommend a good reliable UK hoster?

Anyway, I'm getting an error measage:

Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/...../public_html/cube/admin_GNA7H1.php, with the referer being the product page I am trying to update.

So maybe thats where the problem lies?  It sounds like a server issue to me, although I don't understand these things.  Tech support asked me to let them know what changes I wanted them to make to the server (sounds the wrong way round to me).

Looking in the php options, the memory limit is set at 128M, which sounds big enough to me, particularly when the site is not live and there is only me using it.  I tried increasing it to 256M but it didn't make any difference.

Interestingly enough the php build date was 7 October 2017 which is near enough when the problem started (I can't be sure of the exact date, as I didn't access the site until a couple of weeks after the update) but it was working absolutely fine before that.

Any help would be much appreciated.

Link to comment
Share on other sites

1 hour ago, KevS said:

Can anybody recommend a good reliable UK hoster?

Yes, us ! :rolleyes:  We are the only specialist CubeCart hosting company around, will move your site over to our hosting for free and even provide CubeCart support as part of the hosting.  We currently host and support a very large number of CubeCart sites, many of whom are regulars on here.  If you would like more specific information, please visit our site and if you have any further questions, please register and then open a support ticket and will be very happy to help

Ian

Link to comment
Share on other sites

The PHP options (perhaps you are viewing the PHP Info page in CubeCart's admin) can be misleading if your site is using SUPHP.

On this page, there may be a separate table detailing the SUPHP settings that override PHP's core settings.

How one gets to view any SUPHP error messages, I do not know.

Please review all files in the /images/source/ directory. All files must be image-type files, and all files must not consume huge amounts of memory when opened for editing/resizing. Generally, that means the stored filesize be under 80K.

Link to comment
Share on other sites

The SUPHP error was in the cpanel error log.

I've checked the image folders and they were definitely all jpeg image files .. maximum size was 90k ish but most were around the 40k mark or less.  I ended up deleting them all and adding them back just in case there was one rouge file that was causing the problem. Still the same though.

Another hour with tech support at EUKHost and I'm no further forward, but they have said they will look into it further. 

The other option is I tell my wonderful wife to get a market stall and all my problems will disappear! She does like the online option as well though and winter is coming up.  So I'm with her on that.

Havenswift hosting .. well you do seem to get top class reviews, so you must be very good.  Trouble is I'm such a loyal customer ... to my own detriment at times. I'll give them a bit more time.

Link to comment
Share on other sites

The plot thickens.  No joy with tech support as yet, but when I tried to access the site this morning, it worked for a bit and then threw up an access denied account is over its bandwidth limit error page.  Checked the stats and it said it has used 2.16GB which seams an enormous amount to me.  I don't know where that figure comes from.

I reset the bandwidth limit to 4GB and now the image loading picker box works as it should.  So that's half the problem solved. 

The only outstanding issue is that when you select an image and save it, it all looks fine, but when you edit the product again, it has not saved the image.  However, on the new site I set up on the same domain, it all works perfectly, so Im going to export what I can to the new site and tweek it, so fingers crossed, everything will be OK now.  I'll keep an eye on the bandwidth useage but hopefully that will work out OK if the site is working properly.

Thanks for all your help!!

Edited by KevS
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...