Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix toolbar load when GET params are present in "_wdt" route#32437

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.4fromMolkobain:patch-1
Sep 27, 2019

Conversation

@Molkobain
Copy link
Contributor

@MolkobainMolkobain commentedJul 8, 2019
edited
Loading

When using a custom router that inject GET parameters, eg:

# services.yamlparameters:    # Replace default url generator service    router.options.generator_base_class: Combodo\iTop\Portal\Routing\UrlGenerator

The path generated by the toolbar JS is HTML entity encoded which breaks the JS call (& becomes&).

QA
Branch?4.4 for features / 3.4, 4.2 or 4.3 for bug fixes
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#...
LicenseMIT
Doc PRsymfony/symfony-docs#...

Molkobain reacted with thumbs up emoji
When using a custom router that inject GET parameters, eg:```# services.yamlparameters:    # Replace default url generator service    router.options.generator_base_class: Combodo\iTop\Portal\Routing\UrlGenerator```The path generated by the toolbar JS is HTML entity encoded which breaks the JS call (`&` becomes `&`).
@derrabus
Copy link
Member

Can you provide a minimal application that reproduces the problem?

@nicolas-grekasnicolas-grekas added this to the3.4 milestoneJul 10, 2019
@fabpot
Copy link
Member

@Molkobain Can you tell us more about this issue?

@Molkobain
Copy link
ContributorAuthor

Molkobain commentedJul 27, 2019
edited
Loading

Hello guys,

What do you means by aminimal app?

About the issue, we extended the base UrlGenerator to propagate some parameters to all generated URLs as you will see on the code snippet below. It works fine in the application, URLs are generated as expected.

<?phpnamespaceCombodo\iTop\Portal\Routing;useutils;useSymfony\Component\Routing\Generator\UrlGeneratorasBaseUrlGenerator;class UrlGeneratorextends BaseUrlGenerator{protectedfunctiondoGenerate($variables,$defaults,$requirements,$tokens,$parameters,$name,$referenceType,$hostTokens,array$requiredSchemes =array()){$parameters =$this->getExtraParams($parameters);returnparent::doGenerate($variables,$defaults,$requirements,$tokens,$parameters,$name,$referenceType,$hostTokens,$requiredSchemes);}privatefunctiongetExtraParams($aParameters){$sExecModule = utils::ReadParam('exec_module','',false,'string');$sExecPage = utils::ReadParam('exec_page','',false,'string');if ($sExecModule !=='' &&$sExecPage !==''){$aParameters['exec_module'] =$sExecModule;$aParameters['exec_page'] =$sExecPage;}// Optional parameters$sPortalId = utils::ReadParam('portal_id','',false,'string');if ($sPortalId !==''){$aParameters['portal_id'] =$sPortalId;}$sEnvSwitch = utils::ReadParam('env_switch','',false,'string');if ($sEnvSwitch !==''){$aParameters['env_switch'] =$sEnvSwitch;}$sDebug = utils::ReadParam('debug','',false,'string');if ($sDebug !==''){$aParameters['debug'] =$sDebug;}return$aParameters;}}

The problem comes with the webprofiler in the webpage, when it tries to connect with the backend through XHR, the URL it calls is HTML entity encoded (check the "&"):

http://localhost/pages/exec.php/_wdt/5f220b?exec_module=itop-portal-base&amp;exec_page=index.php&amp;portal_id=itop-portal

The backend then cannot decode the parameters and returns an error.

Edit: Pressed Alt+Enter by mistake. I'm completing the comment and poking you when its complete. Sorry

@Molkobain
Copy link
ContributorAuthor

Edit complete@fabpot@derrabus

@fabpot
Copy link
Member

Thank you@Molkobain.

Molkobain reacted with heart emoji

fabpot added a commit that referenced this pull requestSep 27, 2019
…te (Molkobain)This PR was merged into the 3.4 branch.Discussion----------Fix toolbar load when GET params are present in "_wdt" routeWhen using a custom router that inject GET parameters, eg:```# services.yamlparameters:    # Replace default url generator service    router.options.generator_base_class: Combodo\iTop\Portal\Routing\UrlGenerator```The path generated by the toolbar JS is HTML entity encoded which breaks the JS call (`&` becomes `&amp;`).| Q             | A| ------------- | ---| Branch?       | 4.4 for features / 3.4, 4.2 or 4.3 for bug fixes <!-- see below -->| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | symfony/symfony-docs#... <!-- required for new features --><!--Replace this notice by a short README for your feature/bugfix. This will help peopleunderstand your PR and can be used as a start for the documentation.Additionally (seehttps://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply   (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch.-->Commits-------5309e64 Fix toolbar load when GET params are present in "_wdt" route
@fabpotfabpot merged commit5309e64 intosymfony:3.4Sep 27, 2019
This was referencedOct 7, 2019
@MolkobainMolkobain deleted the patch-1 branchFebruary 13, 2023 12:52
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

5 participants

@Molkobain@derrabus@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp