This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

oskar.villani40843
oskar.villani40843

Hi,

I'm just wondering why the Media-Finder does not display an image as expected.

What I found so far:

  • the image name (and subpath, if given) is stored properly in the table of my plugin. E.g. as "flag_de.png" or "flags/flag_uk.png"
  • the meta definition looks odd to me it is in my case <meta name="backend-base-path" content="/pdsDeploy//backend"> with two (!) slashes inbetween
  • there has been already an issue on git hub, saying this problem is resolved/closed

Any experiences with this? Build is 469 btw.

Thanks in advance!

Last updated

mjauvin
mjauvin

can you show the code/markup used to generate that link?

oskar.villani40843
oskar.villani40843

HI :)

well I'm using a form created with builder, and I am still in backend. So no special code written yet. I played somewhat with the config/cms.php replacing 'backendUri' => '/backend' as it was after installation with 'backendUri' => 'backend' without leading slash. So the double slash vanished, but the image is still not being displayed.

The output html-code in the backend is:

<meta name="backend-base-path" content="/pdsDeploy/backend">
...
<div class="find-object">
    <div class="icon-container">
        <img data-find-image src="/storage/app/media/flag_de.png" alt="" />
    </div>        
    <div class="info">
        <h4 class="filename">
            <span data-find-file-name>flag_de.png</span>
            <a href="nojavascript...;" class="find-remove-button">
                <i class="icon-times"></i>
            </a>
        </h4>
    </div>
</div>

Last updated

oskar.villani40843
oskar.villani40843

Hm,

looks like the img url is not resolved properly in \modules\backend\formwidgets\MediaFinder.php

99        $this->vars['imageUrl'] = $isImage && $value ? MediaLibrary::url($value) : ''; 

But I don't know why. Looks like a setting or path ore somewhat problem. Another installation I am using to explore oc is working fine.

mjauvin said:

can you show the code/markup used to generate that link?

oskar.villani40843
oskar.villani40843

Ok, finally I found the solution, it was simply a installation problem:

Due to installing in a subdirectory the /config/cms.php has to be adapted - as it is described in this file :) - have not found that at the start. Here are the changes to do (approx at line 313 in build 469)

'storage' => [

    'uploads' => [
        'disk'            => 'local',
        'folder'          => 'uploads',
        'path'            => '/storage/app/uploads', // this one has to remain!
        'temporaryUrlTTL' => 3600,
    ],

    'media' => [
        'disk'   => 'local',
        'folder' => 'media',
        'path'   => '/storage/app/media',
        //original: 'path'   => '/storage/app/media',
        'path'   => '/myInstallSubFolder/storage/app/media',
    ],

],

Last updated

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.