Fix repeating of persistent parameter in url#1055
Fix repeating of persistent parameter in url#1055delacry wants to merge 1 commit intocontributte:v6.xfrom
Conversation
|
@rixafy Have you tested with multiple parameters with same value, but different key? For example |
|
@radimvaculik I cannot replicate that, when I try to accept $test, in actionDefault(string $test), and then I add ?test=example.com in url, datagrid will ignore that test parameter for some reason, and it will apply only domainName persistent parameter and grid-* parameters. Anyway, I improved the checking if this happened, after every check it will remove that |
|
Please rebase it @rixafy, if it's still relevant. |
|
It's only relevant for 6.x, I see that in 7.x the code was rewritten to typescript, I haven't test that out and I don't see that function in code anymore. |
When loading clean page with datagrid and persistent parameter included in router url, datagrid js always updated url and added redundant persistent parameter, for isntance:
url where example.com is persistent parameter
domainName=>http://localhost/domain/example.com/cron-taskwould turn into
http://localhost/domain/example.com/cron-task?domainName=example.combecause datagrid js has no way of knowing that there is already that persistent parameter.
In that case, my solution checks for
/example.comin url, and if it's there, it skips that parameter while building url query, I think it's good enough when there is persistent parameter standalone somewhere in url.