You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed a simple bug, same as #88 but since the fix wasn't applied, I figured it needed to be raised again.
When the parameter is already set/active in your current URL, whatever you put in the 3rd parameter @sortablelink('address', trans('fields.address'), ['filter' => 'active, visible']) doesn't override the value.
So if your URL http://127.0.0.1:8000/home?foo=bar&sort=name&direction=asc where foo= bar. Using @sortablelink('address', trans('fields.address'), ['foo' => 'manchu']) will still give you a URL with foo = bar.
The fix is basically swapping the variables $persistParameters and $queryParameters on line 241 of SortableLink.php $queryString = http_build_query(array_merge($persistParameters, $queryParameters, [ so that what you pass @sortablelink overrides what is currently set.
I understand that you can explicitly override the Get variable @sortablelink('name', __('head.name'), ['var' => request()->get('var', 'bar')]) but one should assume that setting a variable in the function call should work. And it's a super simple fix.
Thanks
The text was updated successfully, but these errors were encountered:
@Kyslik yes but if the get variable name is already set, it doesn't override the sortable link to use the one in parameter #3 in the function due to the order they were originally set in the code of the function.
For instance, I use a variable tabs with sortable tables but if tabs is already set in the get variable then it sets the same tabs value in all my sortable links on all my tabs and ignoring what values I set in the function call.
I agree with @seche.
This would for example allow users to have two sortable arrays on one page with the third parameter indicating which sort to use.
Sadly right now I can't find a way to implement this otherwise, and it devalues the use of this package quite a bit for me.
Noticed a simple bug, same as #88 but since the fix wasn't applied, I figured it needed to be raised again.
When the parameter is already set/active in your current URL, whatever you put in the 3rd parameter
@sortablelink('address', trans('fields.address'), ['filter' => 'active, visible'])
doesn't override the value.So if your URL
http://127.0.0.1:8000/home?foo=bar&sort=name&direction=asc
where foo= bar. Using@sortablelink('address', trans('fields.address'), ['foo' => 'manchu'])
will still give you a URL with foo = bar.The fix is basically swapping the variables $persistParameters and $queryParameters on line 241 of SortableLink.php
$queryString = http_build_query(array_merge($persistParameters, $queryParameters, [
so that what you pass@sortablelink
overrides what is currently set.I understand that you can explicitly override the Get variable
@sortablelink('name', __('head.name'), ['var' => request()->get('var', 'bar')])
but one should assume that setting a variable in the function call should work. And it's a super simple fix.Thanks
The text was updated successfully, but these errors were encountered: