-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: relative asset paths #482
Conversation
Hi @jackd248 when looking at the symfony documentation
so our usage seem similar to what the documentation ask, no ? @jordisala1991 are you familiar with such change ? |
@VincentLanglet it depends on how the Web-Server is configured. If the Project is the Web-Root or maybe the If webpack force to hard-code this, then it is bad design in my opinion. |
Your change doesn't work for me either Before: Now it tries to access |
You're right, I wasn't able to fix this problem so far. Do you have an idea how to solve this kind of issue? |
My current hotfix: using your Branch, and then applied my own Redirect Controller class BundleFixController extends AbstractController
{
#[Route('/admin/{something}/bundles/{path}', requirements: ['something' => '.+', 'path' => '.+'], methods: ['GET'])]
public function bundleAction(RouterInterface $router, string $path): Response
{
$baseUrl = $router->getContext()->getBaseUrl();
return $this->redirect($baseUrl . "/bundles/" . $path);
}
} This redirects For Future, I would like to see this webpack getting replaced with AssetMapper in the Future when Symfony 5.4 gets dropped |
So does this PR solve something and should be merged or not ? BTW, it need to be rebased. |
No, right now it just shifts the problem from one wrong path (outside the project), to another (inside the project) For the Base Path Problem, I found this:
@VincentLanglet when is Sonata going to drop Symfony 5.4 Support? |
We're following https://symfony.com/releases#maintained-symfony-branches But you can start a PR with AssetMapper if you want. |
I don't have exp on using asset mapper yet |
Right, this PR is currently not the right solution. I close them for now. |
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.
Closes #480 .
Changelog