Search

Has anyone else had any issues filtering a data source using earlier than {$today} My data source just returns a empty message. Removing the filter returns all the data as expected. Could this be caused by server config or mysql versions?

You have to filter by: "earlier than today" without the brackets an the dollar in today I think..

In one of my site I used "later than yesterday" and it works...

earlier than today does not work either

What version of PHP are you running?

PHP Version 5.2.17 & MySQL Version 5.1.56

I have updated to PHP Version 5.3.6, but still cannot filter by date. If I remove the date filter the data source returns all entries as expected:

<list-past-seminars>
        <section id="8" handle="seminars">Seminars</section>
        <entry id="166">
            <date time="00:00" weekday="4">2009-11-19</date>
            <title handle="trees-and-urban-climate-adaptation">Trees and Urban Climate Adaptation</title>
        </entry>
    </list-past-seminars>

Can you screenshot your Datasource filters?

I can't reproduce the error on my PHP5.3.5 install, so am curious as to why this issue is happening. Does resaving your entries have any effect?

Thanks trying to help with this issue Brendo, really appreciate it.

I have tried re-saving entries, creating new entries, re-creating the ds. As soon as I try to filter on date I get no records returned.

Grab of the DS

Hi all, still struggling to filter entries eariler than today.

Perhaps I could give someone access to my development site.

I'm not sure you can filter by 'today' using the standard date field.

To quickly fix your problem use Nils Date & Time module.

Wow never used this extension looks great.

I have updated me section to use this field but my DS is now throwing a error, without any filtering:

Error creating field object with id 33, for filtering in data source "recent-seminars". Check this field exists

Guessing I should add this to the extension discussion, starting to think its my version of MySQL.

Thanks for trying yo help.

Looks like the .zip fiile download is missing a file? I can't see class.stage.php in the package?

[Thu Sep 08 21:40:14 2011] [error] [client 109.157.65.123] PHP Fatal error: main(): Failed opening required '/XXX/extensions/datetime/lib/stage/class.stage.php' (include_path='.:/usr/share/pear53:/usr/share/php') in /XXX/extensions/datetime/fields/field.datetime.php on line 12

stage is packaged as a separate submodule, you can get it here

The core date field supports the following filters https://github.com/symphonycms/symphony-2/wiki/DateField – using today (relative date) or {$today} (Symphony parameter) should both work. There have been a few issues reporting problems on PHP 5.2, PHP 5.3 should work perfectly.

Regarding the Date and Time download: Github is generating these downloads automatically on the fly and seems to ignore the Git submodule. If you download Stage manually as @touchstone suggested, you should be fine.

Just so everyone knows, I've updated the Symphony Tests extension with a test case for that wiki page Nils linked to.

They all pass on PHP5.3, I'm just trying to find PHP5.2 environment to test them on. If anyone wants to help out and report the results, that'd be even better.

@brendo nice!

For tests like that, should they become part of the Symphony Tests extension, or packaged as part of the Date field? I guess they shouldn't be a part of built-in fields right?

Hard to say Henry, I don't really want to bloat the core with a /tests folder, because I'm pretty sure most people will forget to remove it. Symphony Tests extension isn't a perfect solution, after all it relies on Symphony working to a certain degree to run the extension, but it's a start.

100% code coverage with unit tests is desirable, but it's not realistic at the moment, the best I think we can do is chip away and hope to reach this goal sometime next year. With that in mind, Symphony Tests is a suitable, temporary, solution.

I seem to have (temporarily) fixed this issue with a quick & dirty hack in field.date.php by changing the lower limit on date filters from 0000-01-01 to 2000-01-01. Will be testing for a while to see if anything breaks.

The error happens on my webhost in PHP 5.2 and 5.3.5 but does not in my development machine with PHP 5.3.6.

I'm willing to run tests or otherwise help you debug the issue.

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