Search

Hey all!

I'm trying to get an archive page set up so people can browse through past entries. I'd like to be able to use the same data source to pull entries based on the following parameters:

/year/month/day/entry

I've set the page parameters up as well as the the filtering options for the associate datasource:

Publish Date: {$year}-{$month}-{$day} Title: {$entry}

Now, when I access the page using the various parameters, I get the following:

http://www.mydomain.com/archive/2011 -> returns all entries for 2011 http://www.mydomain.com/archive/2011/04 -> returns all entries for April 2011 http://www.mydomain.com/archive/2011/04/06 -> RETURNS NOTHING :( http://www.mydomain.com/archive/2011/04/06/my-article -> RETURNS NOTHING :(

So, the first two use cases work perfectly, but the last two don't. Is there something I'm doing wrong here?

I'm using version 2.2, btw.

Thanks!

I confirmed the same behavior on one of my sites if I add a day to the filter parameter (2006-08-22). Normally I only filter for year and month.

If I search date on 2006-08-22T19:34:00-05:00 it does return the one article for that date and time.

I'll take a look at the filtering code to see if I can determine why it doesn't filter on day.

I found that when you include a day (2006-08-22) in your search term it is translated to "2006-08-22 to 2006-08-22" and returns nothing. I changed line 346 of field.date.php

$string = "{$string} to {$string}";

to

$string = "{$string} 00:00:00 to {$string} 24:00:00";

and it started filtering correctly. There might, of course, be some way to do this without hacking the code.

Thanks for the suggestions, mate! I'll have to take a closer look at this.

Can anyone else confirm whether this is expected behaviour or an actual bug?

Thanks for all the help!

http://area51.thedrunkenepic.com/blog/

:)

If I understand your issue correctly, I believe I observed this same behavior in the 2.0.1 release.

I just checked v2.2.1 Beta 2 and found that the date-time range for a single day has effectively been changed to what I suggested above. The difference is that the end time is 23:59:59 instead of 24:00:00. So if you update to the latest integration branch it should work now.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details