One big think I would like is to be able to remove any filter criteria (and not only the last one). This could be a major change for a 3.0 version.
I also suggest to add some checks:
- It is possible to add an empty title or body which makes no sense. (Doing this even seems to occassionally prevent other filters to be added (I also obeyed an error about an illegal selection), but not to be reproduced.)
- It is possible to add a 'created before' that is before a 'created after' which would cause to have no matches
- If node status is published, a additional filter node status is unpublished should be prevented, too. Same with start page and sticky
- If a user is selected, the user status should be omitted as an additional filter (the selected user already has a defined status)
Comments
Comment #1
nancydruIf a user is selected (either way), role should also be omitted. This is easy and I have already done this (not committed yet).
Also: if a role is selected the user lists should be limited to users in that role.
I have gotten it to disable the status pairs (e.g. published, not published) but am looking at how to make this more generic in case any other filter has similar exclusive options.
Comment #2
nancydruOkay, I now have it check the title and body values for empty.
Comment #3
nancydruI committed what I have so far. The date validation is hard to figure out. Unfortunately I may not be able to finish this.
Comment #4
FrankT commentedHi Nancy, I updated to the latest dev and startet to select nothing but 'created after' with nothing else selected (so 01.Jan.2009 should be used?). It caused an error 'This value may not be empty.' which is wrong here in my eyes. After that even a reset didn't help.
I also trief with an empty title, same result.
By the way: I suggest to replace the criterion label 'user list' by 'user'
About the date: I don't know exactly what the difficulty is (probably it's the relation between created before and created after). Would it be OK to just deny an 'illegal' date, in other words, if 'created after' has been set, a 'created before' earlier would just need to be denied. I also think that denying a 'created after' in the future is not a difficulty (not mentioned so far).
The rest of of the suggestions seem to work as intended. Thanks for your work.
Comment #5
FrankT commentedJust another thing has come up: if all three (of six) possible node statuses have been used, an empty select field remains instead of causing the criterion to vanish.
Comment #6
nancydruMaybe the next maintainer can finish this.
Comment #7
jonathan.morgan commentedThe problem with 'This value may not be empty.' when adding a date filter (either before a date or after a date) is in cmf.module, lines 610-612 (in the latest dev download). On these lines, the date validate routine is checking to make sure $value has been set, and it seems to never be set when you submit a date.
In my site, I commented out lines 610-612 and date validation filters (after date and before date) now can be added without an error message.
I am not sure if we need to set $value here - it looks like it is more complicated than just grabbing a value, and the fact that it works if you just leave value unset indicates to me it doesn't need to be set, but I'm not sure.
If it would help, I can make and attach a patch (though I haven't actually done that before, so I might need a little guidance for this first patch).
Jonathan Morgan