Closed mfn closed 9 years ago
Seems like a hack to add urlencode
. I didn't implement the pagination, so I'll have to take a brief look :)
I think #44 will solve this?
I think so too; didn't test the code but it makes sense. No +
, no problem :-)
From
\EchoIt\JsonApi\Handler::handlePaginationRequest()
:In case sorting is done via e.g.
+column
(needs to be encoded to%2Bcolumn
in an actual request),$paginator->appends
gets called with+column
which will end up in the generate url withsort= column
(note the space).It seems encoding is applied again and thus needs to be escaped first.
Unfortunately
\Illuminate\Pagination\AbstractPaginator::addQuery()
is sparse on what the expectence is.But in the end the query ends up in
\Illuminate\Pagination\AbstractPaginator::url()
which creates$parameters
, containing the query and thus the sort, and runs it throughurldecode(http_build_query($parameters))
.It seems the following fixes it, but I'm not sure about this approach:
Could be an oversight in the
Paginator
implementation?