sulu / SuluCommunityBundle

Community features like Login, Registration, Password forget/reset for your sulu application.
MIT License
28 stars 38 forks source link

Get wrong URLs with "path" function in twig #134

Open Quehnie opened 3 years ago

Quehnie commented 3 years ago
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}

niklasnatter commented 3 years ago

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()})