Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Saving Category Images not Working (on xampp)


Mort-lemur

Recommended Posts

Ok - so I am playing with V4 on xampp, and have discovered an issue - when I add a new category and try to assign images to that category pressing the "save" button does not actually save the images to the category - in fact it does nothing. - I have a feeling that this is something to do with me running OSC on xampp. The error shown in the log is as follows:

2022-12-22 18:49:41 [127.0.0.1][-][oa4cntjlgne9a243317l955ga3][error][yii\base\ErrorException:2] yii\base\ErrorException: mkdir(): No such file or directory in C:\xampp\htdocs\catalog\lib\backend\design\Uploads.php:35
Stack trace:
#0 C:\xampp\htdocs\catalog\lib\common\classes\TlErrorHandler.php(51): yii\base\ErrorHandler->handleError(2, 'mkdir(): No suc...', 'C:\\xampp\\htdocs...', 35)
#1 [internal function]: common\classes\TlErrorHandler->handleError(2, 'mkdir(): No suc...', 'C:\\xampp\\htdocs...', 35)
#2 C:\xampp\htdocs\catalog\lib\backend\design\Uploads.php(35): mkdir('C:/xampp/htdocs...', 511)
#3 C:\xampp\htdocs\catalog\lib\backend\controllers\CategoriesController.php(5306): backend\design\Uploads::move('PC150111.JPG', 'images/categori...', true)
#4 [internal function]: backend\controllers\CategoriesController->actionCategorySubmit()
#5 C:\xampp\htdocs\catalog\lib\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#6 C:\xampp\htdocs\catalog\lib\vendor\yiisoft\yii2\base\Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#7 C:\xampp\htdocs\catalog\lib\vendor\yiisoft\yii2\base\Module.php(552): yii\base\Controller->runAction('category-submit', Array)
#8 C:\xampp\htdocs\catalog\lib\vendor\yiisoft\yii2\web\Application.php(103): yii\base\Module->runAction('categories/cate...', Array)
#9 C:\xampp\htdocs\catalog\lib\vendor\yiisoft\yii2\base\Application.php(384): yii\web\Application->handleRequest(Object(yii\web\Request))
#10 C:\xampp\htdocs\catalog\lib\backend\web\index.php(29): yii\base\Application->run()
#11 C:\xampp\htdocs\catalog\admin\index.php(15): require('C:\\xampp\\htdocs...')
#12 {main}

Any suggestions would be appreciated.

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

@Mort-lemur

1 hour ago, Mort-lemur said:

Ok - so I am playing with V4 on xampp, and have discovered an issue - when I add a new category and try to assign images to that category pressing the "save" button does not actually save the images to the category - in fact it does nothing. - I have a feeling that this is something to do with me running OSC on xampp. The error shown in the log is as follows:


2022-12-22 18:49:41 [127.0.0.1][-][oa4cntjlgne9a243317l955ga3][error][yii\base\ErrorException:2] yii\base\ErrorException: mkdir(): No such file or directory in C:\xampp\htdocs\catalog\lib\backend\design\Uploads.php:35
Stack trace:
#0 C:\xampp\htdocs\catalog\lib\common\classes\TlErrorHandler.php(51): yii\base\ErrorHandler->handleError(2, 'mkdir(): No suc...', 'C:\\xampp\\htdocs...', 35)
#1 [internal function]: common\classes\TlErrorHandler->handleError(2, 'mkdir(): No suc...', 'C:\\xampp\\htdocs...', 35)
#2 C:\xampp\htdocs\catalog\lib\backend\design\Uploads.php(35): mkdir('C:/xampp/htdocs...', 511)
#3 C:\xampp\htdocs\catalog\lib\backend\controllers\CategoriesController.php(5306): backend\design\Uploads::move('PC150111.JPG', 'images/categori...', true)
#4 [internal function]: backend\controllers\CategoriesController->actionCategorySubmit()
#5 C:\xampp\htdocs\catalog\lib\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#6 C:\xampp\htdocs\catalog\lib\vendor\yiisoft\yii2\base\Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#7 C:\xampp\htdocs\catalog\lib\vendor\yiisoft\yii2\base\Module.php(552): yii\base\Controller->runAction('category-submit', Array)
#8 C:\xampp\htdocs\catalog\lib\vendor\yiisoft\yii2\web\Application.php(103): yii\base\Module->runAction('categories/cate...', Array)
#9 C:\xampp\htdocs\catalog\lib\vendor\yiisoft\yii2\base\Application.php(384): yii\web\Application->handleRequest(Object(yii\web\Request))
#10 C:\xampp\htdocs\catalog\lib\backend\web\index.php(29): yii\base\Application->run()
#11 C:\xampp\htdocs\catalog\admin\index.php(15): require('C:\\xampp\\htdocs...')
#12 {main}

Any suggestions would be appreciated.

Thanks

Not that I know what I'm talking about ... <g>, but I see:

 

C:\xampp in the first line, and in most of the other lines

* but I also see *

C:\\xampp in lines 0 and 11

* Oh, I also see *

both C:\xampp *and* C:/xampp in line 2

maybe ?

Edited by ArtcoInc
Link to comment
Share on other sites

It's not enough. As I said before some features may not work incorrectly under Windows.

Open lib/backend/controllers/CategoriesController.php. And add new line 5307

                    $val = Uploads::move($categories_image_loaded, $imgPath . $imageType, true);
                    $val = str_replace('\\', '/', $val);
                    $val = str_replace(DIR_WS_IMAGES, '', $val);

 

Link to comment
Share on other sites

@pandrei  Thank You.

Using xampp was too slow and clunky, so now I have switched to a server running php 8.

Do the above changes only apply to xampp installations, or should they be applied regardless? as I am still having problems with category images on the live server.

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

4 hours ago, Mort-lemur said:

Using xampp was too slow and clunky, so now I have switched to a server running php 8.

You are absolutely right. That's why we consider windows servers only for test purposes.

4 hours ago, Mort-lemur said:

Do the above changes only apply to xampp installations, or should they be applied regardless? as I am still having problems with category images on the live server.

The above changes fix category images for windows servers only.

Link to comment
Share on other sites

Hi - I am now trying to work with this on an apache server running php 8 with a plesk control panel.

But I am still having issues being unable to upload category images - the error log gives me the following:

[error][yii\base\InvalidArgumentException] yii\base\InvalidArgumentException: common\models\CategoriesPlatformSettings has no relation named "imageMap". in /var/www/vhosts/mysite.co.uk/httpdocs/lib/vendor/yiisoft/yii2/db/BaseActiveRecord.php:1247

I have deleted OSC and reinstalled several times but still the same.

 

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Link to comment
Share on other sites

23 hours ago, Mort-lemur said:

But I am still having issues being unable to upload category images - the error log gives me the following:


[error][yii\base\InvalidArgumentException] yii\base\InvalidArgumentException: common\models\CategoriesPlatformSettings has no relation named "imageMap". in /var/www/vhosts/mysite.co.uk/httpdocs/lib/vendor/yiisoft/yii2/db/BaseActiveRecord.php:1247

I have deleted OSC and reinstalled several times but still the same. 

It's another error. Could you send me the logs? You can use Admin > Settings > Tools > Error Log Viewer > Download all logs for that.

Link to comment
Share on other sites

@pandrei Thank you.

First I am asking the hosting company if there is anything stopping any files being unpacked or run - as during the installation process on the server, the "unpacking files" page went on forever and I had to stop it (after around 3 hours) and manually unzip the files - so I have a feeling that some files may be missing.

Will update when they get back to me - I have wiped the server and left it in a ready to install condition for them to look at.

Many Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...