[FIXED] Cannot upload images + mimetype error + slug error

Started by Razva, October 03, 2011, 15:55:32 PM

Previous topic - Next topic

Razva

Hi,

We're using the latest SVN.

Please take a look at http://www.semineemures.ro/produse/sobe/sobe-lemne - click the "image", you'll see some "Matrix-style" text. :)

When uploading the image the message is:
QuoteFile /home/semineem/public_html/images/stories/virtuemart/product/3 uploaded

But if you open a product - example http://www.semineemures.ro/produse/sobe/sobe-lemne/asia-detail - the image is not there.

The filename of the image was "ASIA.jpg".

Please note that we're also receiving random images regarding:
- mimetype (can't reproduce right  now)
- something about a "slug" and some random generated number

How can we fix this?

Thanks!

LATER EDIT: the image is in the stories/virtuemart/product directory (so it did upload). Still, even if the filename is "ASIA.jpg", VM tells in the admin that the Current File is "3." and the "Displayed title" is "3". Also the path is set as "images/stories/virtuemart/product/3". I have no idea where are these numbers coming from... (3?!).


Milbo

The problem with your error is, that it is afaik completly outdated, therefore try first he new version please :-)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Razva

Hi Milbo :)

We're using the latest SVN (svn co https://dev.virtuemart.net/svn/virtuemart/trunk/virtuemart): Checked out revision 4287.

When posted the topic, we were still using the latest SVN from that day. Is that fixed in today's version?

Cheers! :)

Milbo

ahh okey,.. I didnt know that. I dont have any clue. Maybe the image file is affected with a virus?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Razva

Nopez... We've tried with the same images we already uploaded...

The access credentials are the same, if you wanna take a look... :)

jjk

When I look at your "Asia" product details page, the image shows correctly and the page contains the image information in the screenshot below. But you don't have a corresponding thumbnail image in the /images/shop/resized/sobe-lemne folder, which is required for the category browse pages.

The "%20" in the url is the result of a space character in your image filename.

The "3" you still might see somewhere as a filename probably is a result from a small bug in a previous version. When you upload an image name that already exists, VM2 adds a random number to the filename in order to create a unique slug. For a very short period one of the VM2 RC versions cut off the filename and just left the random number in place. And since VM2 doesn't overwrite existing filenames, you still might have that one in the database table com_virtuemart_media. Try to use 'replace thumb' or 'create thumb' to solve the missing thumbnail for the category browse page.

If an image doesn't show, but you are shure that the image file is in the correct folder, you can also try to type the exact path/filename into the 'used url/used thumb url' fields under the product image tab and click on 'Save' afterwards.



[attachment cleanup by admin]
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

ahh the flypage problem. My last idea was that you maybe use not everytime lowercase for the template files.

But for the image I dont have an idea. Other images work?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

constantined

#8
I suggest to replace

while (file_exists(JPATH_ROOT.DS.$path_folder.$media['name'])) {
$media['name'] = $this->file_name = $this->file_name.rand(1,9);
}

with

$this->file_name = JFile::stripExt($media['name']).'-';
while (file_exists(JPATH_ROOT.DS.$path_folder.$media['name'])) {
$this->file_name .= rand(1,9);
$media['name'] = $this->file_name.'.'.JFile::getExt($media['name']);
}
$this->file_name = $media['name'];

in /administrator/components/com_virtuemart/helpers/mediahandler.php .
It can solve problem with mimetypes.

Razva

I'm noticing that if I upload a new image, it works, but still VM transforms the image into a number. If I'm trying to upload a previously uploaded image, everything goes crazy.

NOTE: should I start over with a fresh installation? We really need to finish this shop, we're two weeks late, and right now we're smashing on various VM bugs/errors. If necessary we can start over...

constantined

#10
Try to cleanup #__virtuemart_medias , #__virtuemart_category_medias and #__virtuemart_product_medias tables and virtuemart  temp image folders.
Don't forget to create backup.

Razva

I found a very simple way to reproduce the bug:

1) create a product, with any name
2) upload a whatever image for that product
3) save the product
----- until here everything is ok
4) create another product, with any name
5) upload THE SAME image as on step 2
6) voila, the error will occur

You can see the error in action on a fresh install - http://www.semineemures.ro/produse/finisaje/finisaje-clasice

I've used the "canaria.jpg" image for both products (Canaria AND Carousel). At the first product (Canaria) the image is right there. If you open the second product (Carousel) you'll see that the image is...not existing! Also in the admin the image is randomly renamed in a number, without any thumbnail (please see attached).

Link: http://semineemures.ro/admin
U: joomla
P: joomla

Note: when making a fresh install I received "Info: Attention dangerous database still active due config setting in file". What's this about?

[attachment cleanup by admin]

constantined

#12
Razva, I can only see that you didn't apply hotfix from this post.

Razva

Quote from: constantined on October 08, 2011, 08:01:40 AM
Razva, I can only see that you didn't apply hotfix from this post.
I just did, and it did the magic! It works right now!

Still, isn't there a way to do this without interfering with Joomla's files?

constantined

#14
It is virtuemart's, not joomla's file. I hope developers will add this to svn.
(still amazed: why they don't use git?)