Ad

Double Theme Name In Media Path In OctoberCMS

- 1 answer

I am sure this is a fault on my side but I would like to see if anyone have any idea how to find the error.

I am using my own theme, based on some other theme.

When I upload files in the media manager in october cms it seem to be working just fine but when I try to get the path, example:

<img src="{{ 'myimg.png' | media }}"/>

it returns the path:

http://my.domain.com/theme-name/theme-name/storage/app/media/myimg.png

When the file is actually located at:

http://my.domain.com/theme-name/storage/app/media/myimg.png

it looks to me like the theme-name is inserted twice, but I can't seem to find anything wrong in the configurations or anything.

So hopefully that is enough information to work with, I will be happy to fill in any missing information but I don't know what more is needed.

Ad

Answer

Turns out it was a bug, and from version 447 it is fixed (I have tried and verified that is the case). Thanks to @LukeTowers for pointing it out!

On builds before 447, the way I found to solve it, was to change in 'webroot/october/config/cms/cms.php' from relative to absolute path, since it is on the server where it will be running that kind of works, and I still have no clue why the relative doesn't work for the case mentioned under storage:

'storage' => [
    'media' => [
        'folder' => 'media',
        //'path'   => '/storage/app/media',
        'path'  => 'https://my.domain.com/october/storage/app/media/',
         ...

Just wanted to leave it for completeness so that anyone else having the problem might either be helped or even explain the parts I can't.

cheers.

Ad
source: stackoverflow.com
Ad