sonata-project / form-extensions

Symfony form extensions
https://docs.sonata-project.org/projects/form-extensions
MIT License
101 stars 26 forks source link

Relative Asset Paths #480

Open jackd248 opened 7 months ago

jackd248 commented 7 months ago

Environment

Sonata packages

show

``` $ composer show --latest 'sonata-project/*' Direct dependencies required in composer.json: sonata-project/admin-bundle 4.29.3 4.29.3 The missing Symfony Admin Generator sonata-project/classification-bundle 4.8.0 4.8.0 Symfony SonataClassificationBundle sonata-project/doctrine-extensions 2.3.0 2.3.0 Doctrine2 behavioral extensions sonata-project/doctrine-orm-admin-bundle 4.15.0 4.15.0 Integrate Doctrine ORM into the SonataAdminBundle sonata-project/exporter 3.3.0 3.3.0 Lightweight Exporter library sonata-project/intl-bundle 3.2.0 3.2.0 Symfony SonataIntlBundle sonata-project/media-bundle 4.11.0 4.11.0 Symfony SonataMediaBundle sonata-project/translation-bundle dev-3.x-dev-kit e6ea40d dev-3.x-dev-kit e6ea40d SonataTranslationBundle Transitive dependencies not required in composer.json: sonata-project/block-bundle 5.1.0 5.1.0 Symfony SonataBlockBundle sonata-project/form-extensions 2.3.0 2.3.0 Symfony form extensions sonata-project/twig-extensions 2.4.0 2.4.0 Sonata twig extensions ```

Subject

We're using symfony instances on our staging system in subdirectories. Unfortunately we ran into the problem, that the public assets of the sonataform bundle points to absolute paths.

I think the paths need an relative "./" to be more flexible. See entrypoints.json and manifest.json.

I'm not so familiar with the webpack config, but I think changing the public path may deals with this fact, see webpack.config.js.

Hanmac commented 5 months ago

I got same problem:

It tries to access https://localhost.local/bundles/sonataform/379.js but it should try to access https://localhost.local/<project>/public/bundles/sonataform/379.js