SuluCommunityBundle icon indicating copy to clipboard operation
SuluCommunityBundle copied to clipboard

Get wrong URLs with "path" function in twig

Open Quehnie opened this issue 4 years ago • 1 comments

Q A
Bug? yes
New Feature? no
Community Bundle Version develop#73011f99e73fdd540e4b91175d52032253994743
Sulu Version master#96096d163f29679215845f3877fa67da33f377ef

Actual Behavior

if in dev environment path('sulu_community') = /de/login when changed into stage env path('sulu_community') = /login so it creates a redirect and lose my post data. both webspaces environments are with /{localization} and the route include is type portal.

Expected Behavior

in both environments it will prefix the language.

Steps to Reproduce

Install sulu and change env, just look at the action of the login form.

Possible Solutions

I fixed it by removing type portal and add prefix: /{_locale}

Quehnie avatar Sep 14 '20 14:09 Quehnie

I think we need to pass the prefix of the current portal to the path() function. Have not tested it, but that should look something like this:

path('sulu_community.login', {prefix: app.request.attributes.get('_sulu').getAttribute('portalInformation').getPrefix()})

niklasnatter avatar Sep 25 '20 07:09 niklasnatter