Jump to content

5.24 Filemanager problem


Dirty Butter

Recommended Posts

I have this section in my products.index.inc.php:

	// Filemanager - Images
// if (($uploaded = $filemanager->upload()) !== false) { KNOWN BUG
	
if (($uploaded = $filemanager->upload() && is_array($uploaded)) !== false) { // Fix for invalid argument for next statement
		foreach ($uploaded as $file_id) {
			$_POST['image'][(int)$file_id] = true;
		}
	}

When I created a new product, I had to manually click on the X to change it to a star to make the image show up in the product listing. What needs to be done to fix this section?

Link to comment
Share on other sites

That fix is for those who really, really want the warning message to no longer appear in the error log. That code, unchanged, has no affect on the operation on CubeCart.

 

Unchanged, an error is logged if there was no image uploaded when the product details form was submitted. If one or more images were submitted, then the foreach would have a valid argument and all would be peachy with the world.

 

If you wish to have the one and only image uploaded and/or assigned to a product to automatically be 'starred', then we need to look elsewhere.

Link to comment
Share on other sites

If you wish to have the one and only image uploaded and/or assigned to a product to automatically be 'starred', then we need to look elsewhere.

 

OK. Normally our plush items only have one photo, so it always did automatically star it before 5.2.4. When we had multiple images it check marked all but the last one and starred that one, all automatically.

Link to comment
Share on other sites

"When we had multiple images it check marked all but the last one and starred that one, all automatically."

 

That's still in the CC524 code. None of that has changed.

 

I have not yet splayed out the CC523 nor CC524 code, so I do not yet know how these versions work. Yet.

Link to comment
Share on other sites

In CC524, products.index.inc.php, line 345, starts the processing of the list of images that are being uploaded. The first thing it does is to get the list of uploaded images from $filemanager->upload().

 

The CC524 file /classes/filemanager.class.php, line 589, function upload(), is the code that changed after CC522. I don't know what the change affected.

 

My impression is that, even with the changes in filemanager, nothing different happens in products.index.inc.php.

 

So, look in your CC522 Filemanager->upload() to determine if you made any edits that affect the CC_image_index table. (I find that difficult to understand why an edit to do that would be placed in this function, however.)

Link to comment
Share on other sites

Assuming (big assumption!) there is no intended difference between Pro and Lite with regard to automatically 'starring' the last image in the set that was uploaded, let's look at the possibility that the database is corrupt.

 

Are you using a test database for the Lite CC524? If so, please have phpMyAdmin check the validity of the CC_image_index table for the Pro CC524. (Just a wild guess.)

Link to comment
Share on other sites

I've tried the same image upload on a test product on the estates store, and it's also not automatically putting the star - and the image_index does not have anything. So it's not a database issue. I created MY plushcatalog 5.2.4 and used it to create the estates 5.2.4 with a few differences, so it's a software issue.

 

I'll mark them manually with the star until you've had time to work it out. Thanks!!!!

Link to comment
Share on other sites

I finally tracked it down by a process of elimination, exchanging my folders/files with original 5.2.4 versions until I was able to get an image to work automatically. The problem in products.index.inc.php was my attempt to include an edit that was supposed to be a fix for no options to be processed causing error messages. Either I merged that edit incorrectly, or it's not needed in 5.2.4.

 

You can mark this as resolved.

Link to comment
Share on other sites

Maybe this isn't quite resolved after all. I added back in this code again to products.index.inc.php, since I now have a working copy of this file. Again, with this added, I do not get a starred image automatically. So evidently this bug fix needs tweaking.

	// Filemanager - Images
	// if (($uploaded = $filemanager->upload()) !== false) { KNOWN BUG PER BSMITHER
if (($uploaded = $filemanager->upload() && is_array($uploaded)) !== false) { // Fix for invalid argument for next statement
		foreach ($uploaded as $file_id) {
			$_POST['image'][(int)$file_id] = true;
		}
	}
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...