Skip to content

[bug] asset can not load from relative path #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghanbari opened this issue Apr 22, 2015 · 10 comments
Closed

[bug] asset can not load from relative path #142

ghanbari opened this issue Apr 22, 2015 · 10 comments

Comments

@ghanbari
Copy link

my project is in subdirectory of web root, /var/www/test/a/symfony_root_project/web

when i open http://localhost/test/a/symfony_root_project/web/elfinder, i see that bundle try load asset from /assets/jquery/jquery.js and no from /test/a/symfony_root_project/web/assets/jquery/jquery.js

@ghanbari ghanbari changed the title [bug] asset can not load from relative path asset can not load from relative path [bug] Apr 22, 2015
@ghanbari ghanbari changed the title asset can not load from relative path [bug] [bug] asset can not load from relative path Apr 22, 2015
@gittix09
Copy link

Hello!! I had the same problem... Elfinder was not loading at all and there were a lot of '404 Cannot load resource...' in the browser console.
I solved the problem creating a "domain" that points to the symfony_root_project/web directory.

For example "mysite.localhost". So, the link given to elfinder would be http://mysite.localhost/app_dev.php/elfinder (dev environment)
or
http://mysite.localhost/elfinder (prod environment)

Hope this helps

@wadjeroudi
Copy link

You need to set the variable "assets_path" in your elfinder config:

fm_elfinder:
    assets_path: '/subfolder/assets'
    instances:
        default:
            ...etc

@xserrat
Copy link

xserrat commented Sep 28, 2015

Hi,

I am using this bundle in order to load images from a server but I have the same problems when I try to load assets. Are there some config to set the correct route without setting manually with 'assets_path' key?

Thanks.

@helios-ag
Copy link
Owner

The default behaviour for bundle is a project with configured vhost, and configured composer.json with following settings:

{
    "config": {
        "component-dir": "web/assets"
    }
}

So assets placed under web/assets folder. But if you move assets somewhere else manually, you should set assets_path.

@xserrat
Copy link

xserrat commented Sep 29, 2015

Thank you @helios-ag for your clarification but I haven't moved my assets. The only thing is that my configured vhost has an alias in order to define symfony project as a specific path as you can see at bottom:

www.example.com//

This configuration is used in order to have routes in a different symfony projects because of each one will be placed at different web server. So in this case, I don't know if it would be possible that bundle getting the symfony root path to define where is the "/" page and knowing the assets path.

@helios-ag
Copy link
Owner

Well, in this case, do you have elfinder assets under vendor dir? The 'component' should copy them from vendor dir to web/assets directory, according to component - dir option.

@xserrat
Copy link

xserrat commented Sep 30, 2015

Yes, I have elfinder assets directory defined as you said previously. The possible solution could be to change component-dir value through command-line (because depending on the environment I need a value or another one). However, this solution causes the composer update command usage because of composer use the new config value on execute, and the good solution would be using the composer install command in order to use the same composer library versions in dev and prod environments.

Thanks for your responses.

@helios-ag
Copy link
Owner

There is also option to use version 4 of the bundle, which contains assets 'internally'.

@xserrat
Copy link

xserrat commented Sep 30, 2015

Perfect, currently I was using version 5.1.

@sunviwo
Copy link

sunviwo commented Aug 3, 2017

@gittix09 can't find any "domain" option in this bundle's configs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants