I'm trying to use craft.request.getQueryStringWithoutPath() to handle query strings on pagination, but for some reason it always seems to return an empty string. If I try craft.request.getQueryString() I get the query string as expected (eg. foo=bar), but with the exact same URL getQueryStringWithoutPath() gives me an empty string.

Am I doing something wrong? Could this be a server configuration issue (I'm using Apache 2.4 with a fairly default configuration)? Or could this be a Craft bug...? I'd be grateful for any help!

  • Per Brad's answer, this is a bug and has been fixed for the next release. Closing as a "bug report". – Lindsey D Nov 24 '15 at 19:51

Turns out this was a bug that only occurred if the existing URL didn't have an URI associated with it. i.e. http://craft.dev?foo=bar.

It's been fixed and will be included in the next 2.5 beta release (or the first 2.5 public release if you don't want to swap to the beta track).

  • Ah, spot on, thanks Brad - the issue was on the home page so sounds like that's it. Out of interest, is there a schedule (even a rough one) for the 2.5 public release yet? No problem if not, but thought I'd check. – Nick F Nov 24 '15 at 20:39
  • 1
    Yup... read in here: pixelandtonic.com/blog/craft-2.5-beta – Brad Bell Nov 24 '15 at 21:49
  • Yikes, sorry, missed that! Next week - that's excellent. Thanks again. – Nick F Nov 25 '15 at 1:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.