Support datetime field type

jhodgdon - March 13, 2009 - 17:12
Project:CCK Facets
Version:6.x-1.x-dev
Component:Date Facets
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

It looks to me as though the "datetime" field in the Date module (at least as of Date 6.x-2.0) is the field that is recommended to use.

CCK Facets doesn't currently support it, however.

So this is a request to add support for the "datetime" field in the CCK facets "CCK Date Facets" module.

#1

jhodgdon - March 13, 2009 - 17:13
Assigned to:Anonymous» jhodgdon

I'm going to work up a patch in the next few days for this.

#2

jhodgdon - March 13, 2009 - 19:40

Scratch this!!

AttachmentSize
datefacets.patch 3.39 KB

#3

jhodgdon - March 13, 2009 - 19:53

That patch works except for the "fix me" section that I forgot about. It has to do with the block for "related categories" when you are viewing a node.

#4

jhodgdon - March 13, 2009 - 19:50
AttachmentSize
datefacets.patch - corrected 3.9 KB

#5

jhodgdon - March 13, 2009 - 19:52
Assigned to:jhodgdon» Anonymous
Status:active» needs review

Sorry about that. This patch in #4 is the correct one to use.

I tested all the blocks in CCK Facets, and they all seem to be working with my "datetime" field now. When I attached that first patch, I didn't have the "related categories" block enabled, and that first patch didn't fix up that part of the code.

Tested under Drupal 6.10, Date 6.x-2.0, and CCK Facets 6.x-1.x-dev.

#6

David Lesieur - March 15, 2009 - 06:33

Reading the code, it looks like the datetime_facet_category is not needed (it only calls its parent's constructor, and does not override anything from the base class). It looks like using the date_facet_category class would do just the same. And then if date_facet_category can be used, it looks like the datetime_facet class won't be doing anything different from its parent date_facet class.

So unless I am missing something, your handling of the 'datetime' field is the same as for the 'date' field. Am I right? If so, aren't there some differences between the two that would need to be taken into account? If not, then the superfluous classes should go away. :-)

#7

David Lesieur - March 16, 2009 - 15:00
Status:needs review» needs work

#8

jhodgdon - March 16, 2009 - 15:42

I was wondering about that too. I had made a comment when I submitted the patch, but it got lost... Anyway, I agree that it is probably not necessary to have the new classes. I added them to be consistent with the other handling, but given the current functionality of date facets, the new classes are not necessary.

#9

jhodgdon - March 16, 2009 - 16:54

Just a note that I decided not to use Date Facets, so updating this patch is probably not my highest priority right now.

One reason I decided not to use it is that for a repeating event, the "related categories" block that is shown on a node has a huge number of dates in it, in seemingly random order. I am not sure why the order is so bad, or why the related categories block is not respecting the settings I made on the facet environment (e.g. show only 10 date facets, and order by date), but that's probably a separate issue for Faceted Search.

Also I decided it made more sense to do date-related searches using a calendar rather than a list of date facets.

 
 

Drupal is a registered trademark of Dries Buytaert.