this file needs to be renamed to not sure how to make a patch with a new file; even the -upN option didn't work for me.

patch needs work; it's just a start (and doesn't seem to work right for even what it purports to do).

Members fund testing for the Drupal project. Drupal Association Learn more

Comments’s picture


principessaDS’s picture

14.07 KB

Attached is my start on porting. To say it needs some serious work would be an understatement, as

  • arguments keep giving me some occasional ajax errors that I have yet to figure out.
  • needs work for Postgre support
  • default event views I left out for the time being
  • the standard Drupal formatting is sorely lacking
  • it's a copy of my file, not a proper patch

Testing, thoughts & help would be greatly welcomed.’s picture

Project: Event » Event Views

Event views is its own project, moving over there.

aaron’s picture

Deprecate Event Views.

I don't think it's necessary to continue to have a separate Event Views. The module would at its bare bones consist only of this:

// $Id$

with the obligatory file and

Seems simpler to just use and forgo having to enable a module that does nothing that Views 2 doesn't already do (as far as automatically including a properly named .inc file).

MTecknology’s picture

How can I subscribe without needing to make a post?

pfaocle’s picture

Currently trying the code from #3 as modules/event/, seems OK so far. I'm not using arguments but simple filtering and sorting is working.

Morn’s picture

The patch (#3) doesn't work anymore with Views 6.x-2.0-rc2, in the Sort options of Views I get Error: handler for event > event_start doesn't exist!"
any idea how to correct this in the patch?’s picture

Have you read about the API change in the release notes? Could this be where the rub is?


Morn’s picture

Comparing, for example from rc1 and rc2 you can see that a lot was changed (reduced) from line 221
on now we have there

 * Implementation of hook_views_handlers() to register all of the basic handlers
 * views uses.
function profile_views_handlers() {

replacing lots of code

I think something similar must be done at

chasz’s picture

is this still being worked on or being squeezed out?

principessaDS’s picture

I have not had a chance to work further on the ported include file I originally uploaded in #2, nor have I had a whole lot of feedback on it either. Note also that I am not the maintainer of this module, just trying to help out.

Views 2 6.x-2.0-rc2 was released long after I logged off last night. If you will have a bit of patience, I will try to track down the issue in the next few days. As always, constructive help and suggestions are welcome.

pfaocle’s picture

merlinofchaos did post something on his blog about API changes - there's also a comment which might help.

principessaDS’s picture

I'll preface this with a few caveats:

  • The attached files are for Views 2 6.x-2.0-rc2 and Event 6.x-2.x-dev ONLY.
  • As noted previously in my original post#2, this code needs work.
  • Addendum: I would strongly suggest that if you are not comfortable with PHP coding or are new to Drupal that you do not use this module as it is not ready for production use on live sites.

There are a few hoops to jump through for this version due to the API changes in Views.

  1. Extract the file to your event module directory (i.e. the end result should be like sites/all/modules/events/includes)
  2. Rename event.views_for6.x-2.0-rc2.inc_.txt to and place it in your event module directory (i.e. sites/all/modules/events/
  3. Edit your event.module file, adding the following code at the bottom of the file:

     * Implementation of hook_views_api().
    function event_views_api() {
      return array(
        'api' => 2,
        'path' => drupal_get_path('module', 'event'),
  4. Empty your cache at admin/settings/performance
  5. Empty the views cache at admin/build/views/tools. If you can't reach that page due to errors, empty the cache_views table manually.

These files are strictly to deal with the Views API changes in 6.x-2.0-rc2; I have not yet mucked about with the issues listed in post #2.

NB: Edited for clarity in response to posts #15 through #18.

Morn’s picture

(#13) It works!!
I Use the event start_date field for sorting an everything looks fine.
Thank you for the help

chasz’s picture

can u run this by me again please LOL

one and 2 confused me !! insert into folder or file?

Morn’s picture

For (#15)
1. I inserted the folder (its new)
2. I inserted the file

chasz’s picture

how did you guys get this to work with drupal 6,4?

Morn’s picture

I am using Drupal 6.4:
I first installed the new versions of Views and cck and verifyed that they work (don't forget update.php).
After confirming that all is OK, except the event views, I deleted the event folder and replaced with an event folder
Version prepared as in #13 (don't install the offficial event views module!!).
Then I runned, cleared caches and that was it.

chasz’s picture

i am sorry but that made absolutely NO sense

nedosa’s picture

This is cool. It worked for me. One thing I'm having problems with is filtering View items based on the start date. I'd like to use the "between" filter, where only events that are between the current date and some future date appear.

Thanks again.

miiimooo’s picture

Woohoo! Method also works with:

Views 6.x-2.0-rc4
event HEAD


bshensky’s picture

Category: feature » support
Status: Needs work » Patch (to be ported)

I dig it! As of 09 October 2008 04:00 GMT, method also works with


Talk about a lifesaver!

Thanks a million - hope we get a working event_views for 6.x someday...

weldong’s picture

hi, I tried principessaDS's procedure and it works except I am having trouble with getting a view to work where it Lists the date (1st by years, then by months) that I can do easily in drupal 5.x

It is basically working except the Link Text for the links are blank, and therefore no links

I get:
* (138)
* (2)

and I should get
* 2008 (138)
* 2009 (2)

the source code of the page reveals the links are generated correctly (listed below), if I go to /event/2008, I get simular results, just a LI for each item and a count but no text to click on but source code reveals the links are correct). If someone can point me in the direction where this code is generated, I will be happy to try to fix myself.

Thanks in advance!!

<li class="2 last"><a href="/admin/build/views/clone/event_view">Clone</a></li>
</ul>    </div>
      <div class="view-content">
      <div class="item-list">
      <li><a href="/events/"></a>
      <li><a href="/events/2008"></a>


weldong’s picture

The bug in #23 occurs in function summary_name and function_title in event_handler_argument{month,day,year,fulldate}.inc . By commenting these functions out, I at least get text to the links (being the number of the day, month, year, etc).

ivrh’s picture

Hi. Could not make exposed filters to work (event start date and end dates).

What I found is that this patch is trying to compare values from the database with the values from exposed filter. The issue was that the DB values are stored in YYYY-MM-DD HH:SS format, while values in the exposed filters are converted into UNIX timestamp.

This change (to the file "") below make them working fine:

// $Id:

class event_handler_filter_date extends views_handler_filter_date {

  function op_between($field) {
    if ($this->operator == 'between') {
      $a = intval(strtotime($this->value['min'], 0));
      $b = intval(strtotime($this->value['max'], 0));
    else {
      $a = intval(strtotime($this->value['max'], 0));
      $b = intval(strtotime($this->value['min'], 0));

    if ($this->value['type'] == 'offset') {
      $a = 'NOW()' . sprintf('%+d', $a); // keep sign
      $b = 'NOW()' . sprintf('%+d', $b); // keep sign
    // %s is safe here because strtotime scrubbed the input and we might
    // have a string if using offset.
    $this->query->add_where($this->options['group'], "UNIX_TIMESTAMP({$field}) >= %s", $a);
    $this->query->add_where($this->options['group'], "UNIX_TIMESTAMP({$field}) <= %s", $b);

  function op_simple($field) {
    $value = intval(strtotime($this->value['value'], 0));
    if ($this->value['type'] == 'offset') {
      $value = 'NOW()' . sprintf('%+d', $value); // keep sign
    $this->query->add_where($this->options['group'], "UNIX_TIMESTAMP({$field}) {$this->operator} '%s'", $value);

Namely the chaged lines were:
$this->query->add_where($this->options['group'], "UNIX_TIMESTAMP({$field}) >= %s", $a);
$this->query->add_where($this->options['group'], "UNIX_TIMESTAMP({$field}) <= %s", $b);


$this->query->add_where($this->options['group'], "UNIX_TIMESTAMP({$field}) {$this->operator} '%s'", $value);
all $field variables are now prefixed with UNIX_TIMESTAMP() function.

This works with Views 2.0 and Drupal 6.5.

duntuk’s picture

i couldn't get the filters to work to show only current or upcoming events... it would show all events, no matter what i put in the filter.

Basically trying to replicate the functionality of the upcoming events block which comes with events module--however, trying to add extra functionality by showing only events that under a specific taxanomy, for instance.... current block shows all upcoming events, no way of filtering.

Shiny’s picture

Works in everyway, except filters.

(tested on postgresl 8.3 + php5-cgi + lighttpd)

Perhaps this can be made an issue on the events project, and get the fully working parts into the events module, and then deal with filters seperately

marcingy’s picture

OK this doesn't need to be included in the event module it can stay as a seperate module. The events views module simply needs to have the hooks_views_api included within it. The includes can then live with that sub directory and the code can be developed out with the main events module. I'm sure Killes split the code out for a reason. And if he wants a co-mainter for this module I'm more than willing to take on the role ;-)

pfaocle’s picture

Category: support » task
Status: Patch (to be ported) » Needs work

#13 Still working in the most part for me (although I'm not doing anything too complex) - I guess what we need is a patch for #13 against the last 6.x-2.x-dev release for review.

domesticat’s picture

Seems to work pretty well after basic testing.

mradcliffe’s picture

It looks like the issue with the filter is doing a typecast from datetime to integer when adding the seconds to the date.

event.event_start          NOW()+86400
2008-12-20 20:22:00  	20081217241302.000000

Instead mysql or postgresql's date operators need to be used, or do it in php (most likely scenario as dates are pretty different in mysql and postgresql). Though I can't remember if postgresql is supported in event at all.

postgresql: now() + interval '1 day'
mysql: date_add(now(),interval 1 day)

In my implementation of event_views from august ( I did things in php. Note that code is radically different from this module.

I used php 5's new date functionality reluctantly. For instance,

$date = new DateTime("2006-12-12");
$date->modify("+1 day");
echo $date->format("Y-m-d");
Toddv’s picture


Toddv’s picture

In case it's helpful to the maintainers: The code in #25 did not solve the time problem for me, date values displayed "12/31/1969 - 16:33". I doubled checked caches and such. Thanks for your efforts folks! (using d6.8, event 6.x-2.x-dev)

Fr0s7’s picture

I agree, since #13 does not work for me using Drupal 6.8 and Event 6.x-2.x-dev. (Had no expectations, but it was fun to try. ;p )

Morn’s picture

#13 still working for me with Drupal 6.8 and event 6.x-2.x-dev Version from Dec. 28. (I only use a start date filter)

KelvinWong’s picture

#13 is not working on Drupal 6.9, Event 6.x-2.x-dev (2009-Jan-02) & Views 6.x-2.2
I got "Error: handler for event > event_start doesn't exist!"

SocialNicheGuru’s picture

I agree with comment #36.

I get Event views is not compatible with this version of Drupal which is 6.9

Morn’s picture

#13 still working for me with Drupal 6.9 and event 6.x-2.x-dev Version from Jan. 26. (I only use a start date filter)
At #36-#37, did you copy the directory includes and the file to the event directory, and modified event.module as stated in #13?

Nick_h’s picture

Verified that this works with the Views 6.x-2.2

adam_b’s picture


Equ’s picture

subscribe, we need this module. thanx.

srjosh’s picture

Let me know if I can be of service to this update; we need this module too.

Liliplanet’s picture

subscribe’s picture


momper’s picture


Equ’s picture

Sorry for this question, but is anyone actually working on this? We are using Event module for a long time, at the same time we've been waiting for the Views integration. Without Event + Views we can't move forward.

mradcliffe’s picture

Who knows what the status of the module is since killes hasn't commented on anything here for months.

It could be deprecated and the code put back into event as the main patch above does. Or it could still live on its own as its own module. I went ahead and coded my own version of event views to my own liking because it was actually easier than porting the 5.x for that project (time/budget constraints). It's actually pretty easy to hack out basic views support, I think it took me 4-5 hours.

At this point it probably won't get resolved until there's an actual release of the event module for 6.x (I've been using devel successfully since Q3 2008).

esplinter’s picture


Morn’s picture

#13 still working with drupal 6.10 and event 6.x-2.x-dev (26 March Version) -
That patch should be included in the actual dev. event version in order to have an event Version with included Views 2 support.

srjosh’s picture

Quoted from an email from Gerhard Killesreiter :

"I currently do not have much time to work on event.module. I have even
less time to work on event_views.module. Hence I need your (and
everybody else's) help in testing the current versions that are either
in cvs or in patches in the issue queue.

One unfortunate bug is an upgrading issue that I need to investigate. If
any of you can share a dump of a site which has many events in event 5.1
format, this could help with testing this."

hope that helps.

eileenmcnaughton’s picture


mgifford’s picture

I'd just assumed that this would be here so I could create a custom calendar block.


domesticat’s picture

I've been following this issue for a while, and I'm wondering if maybe someone should state the obvious here. From what I've seen, it seems like Event is mostly being maintained for legacy users while most forward development seems to be coming from the cck + views + calendar side.

If you can demonstrate otherwise, please speak up?

I ended up doing a conversion from the 6.x version of Event to the 6.x version of CCK + views + calendar. I used this page from PingVision to get me started, though that script was not what I ended up using. I am hesitant to post my copy of the script until I could have someone help me test it -- if you are interested, have a site you can play with, and are comfortable with editing PHP/mySQL statements, contact me privately through this site and we'll give it a go.

Major caveat: Please note that I have no knowledge of how repeating events worked under Event, and I have zero idea if this script could be used for repeating events under Event.

The end result of my script was pretty seamless for us. I took the existing 'event' nodes, added on a CCK field for the new start time, used the script to generate the date fields in the format that CCK expects, and then inserted those fields into the database. I then created new versions of my views, blocks, and pages doing sorts based off of the CCK date fields, and once I had those matching the old versions, I turned off the Event module.

Again - if you're interested, comfortable with script hacking, and can be patient with someone who is carrying a massive work overload, contact me. Maybe we can get something going that will solve the long-term needs of the people in this thread.

eileenmcnaughton’s picture


I had been wondering about how important events are when views can do much the same thing but OG Calendar seems to rely on it which the customer wants - but maybe the results of OG Calendar can be achieved using views 2 anyway?

cka3o4h1k’s picture


barm’s picture

Title: Views 2 Support for Event » #13 is working, but arguments is not a Date argument

I am trying to edit date_browser view of calendar style.
There is not events date arguments (like event start date ...) in section "Date field(s):" of argument "date".

When I trying to make my own argument and select "Event:Start date", then I read:

* The calendar_style style requires a Date argument.
* The Date browser style requires the Date: Date argument.

Where am I wrong?

barm’s picture

Title: #13 is working, but arguments is not a Date argument » Views 2 support


thierry.beeckmans’s picture

I've noticed this module and hoped I could use it. But apparently it didn't work for me (drupal 6.10), are there changes in the views2 api since this module was written?
Anyway, based upon another views implementation, I added some primitive functionality for what I needed: Managing the start & end date.
This is based upon the existing views classes, this means that the existing date functionality from views remains the same.

1. Add the following code to the event.module:

 * Implementation of hook_views_api().
function event_views_api() {
  return array(
    'api' => 2,

2. Place the attached files in your event module. Remove the .txt extension!

3. List your modules under /admin/build/modules (in order to let the system detect the newly added files & detect the views hook)

Drupal Centric’s picture

#13 worked a treat for me using Views 6.2.5 and Event 6.x-2.x-dev, thanks.

momper’s picture

Title: Views 2 support » Event Views: Views 2 support
Liliplanet’s picture

Thank you so much, definitely works in every way ..

chrism2671’s picture

Is this now committed to the dev trunk?’s picture

I was about to add it to CVS but it looks a bit incomplete. Can somebody post a view that was created with this?

dikovina’s picture

#58 - works great!’s picture

Status: Needs work » Postponed (maintainer needs more info)

changing status

SomebodySysop’s picture

Has anyone who has gotten this to work got it to work with Drupal 6.13 core?

emdalton’s picture

I was not able to get #58 to work with Drupal 6.12. I guess I'll work on migrating my data to CCK instead. A note explaining that the module is no longer being maintained would seem appropriate....

hchall’s picture

13.51 KB
25.39 KB

On upgrading from Drupal 5 to Dupal 6.13, I am getting 'broken/missing handler' for 'event_start' and 'event_end' fields when trying to convert my views1 to views2. I would like to filter nodes on this important data, and wonder if you or other developers are working on a solution, or if I need to abandon such hope and mirror this information to CCK date fields (Date API). #58 fix did not work.
That is, what can I do to make this fix a priority?

SomebodySysop’s picture

For the record, I abandoned hope and converted my event dates to cck.

I used the cck date module and date api. I created a cck field called eventstart. I used "now" as the default from and to dates. I used "date" as the format.

I then used this code to convert all the event dates to the cck eventstart field:

// You backed up your database, right?

// Set up the mysql connection
// Drupal's bootstrap function may be substituted here
// require_once '/path/to/drupal/includes/';
// drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$con = mysql_connect('localhost', '', '');
$count = 0;
mysql_select_db('', $con);

// Cycle through all the records in the event table
$q = 'select * from event';
$r = mysql_query($q);
while ($row = mysql_fetch_assoc($r)){

// Transform the date information
// CCK date format: 2008-12-10T00:00:00
// event date format: 2006-11-13 15:00:00
  $startdate = preg_replace ("/ /", 'T', $row['event_start']);
  $enddate = preg_replace("/ /", 'T', $row['event_end']);
  $nid = $row['nid'];
  $node = node_load($nid);
  $vid = $node->vid;

$timezone = 'America/Los_Angeles';

$node->field_eventstart[0]['value'] = $startdate;
$node->field_eventstart[0]['value2'] = $enddate;
$node->field_eventstart[0]['timezone'] = $timezone;
$node->field_eventstart[0]['timezone'] = $timezone;
$node->field_eventstart[0]['timezone_db'] = $timezone;
$node->field_eventstart[0]['date_type'] = 'date';

$node = node_submit($node);


print "
".$count." records converted.";

You may have to change the $timezone, but otherwise, should work. Note that you use the "event" content type for this new "eventstart" field, you will have to modify your existing views to replace the event.module "event_start" field with cck "eventstart".

Niek_Kloots’s picture

It works with:
Drupal 6.13
Views 6.x-2.6
Event 6.x-2.x-dev (2009-Mar-16) example:

doesn't work with:
Event 6.x-2.x-dev (2009-Jul-05) example:

both sites use all the same modules. Only the event dev. is different.

doughold’s picture

#58 worked like a charm, events dev from Aug 29...Views2 6.x-2.6

Niek_Kloots’s picture

Category: task » feature

Now #58 works for me also.

Drupal 6.13
Events dev from Aug 29
Views2 6.x-2.6

Still would like the choice between days or date in the upcoming event block included

TRex2003’s picture


Rob_Feature’s picture

I just want to give a shoutout to SomebodySysop on #69. Brilliant! This is obviously an updated version of this code (which does NOT work).

Just wanted to say thanks...I'd recommend putting your solution somewhere that Google and Drupal search can find it! I took the liberty of archiving it for others here. It's gold for people who want to make the switch. Thanks!

mauryg’s picture

I am running:
Drupal 6.14
Event 6.x-2.x-dev (2009-Aug-28)
Event Views 6.x-2.x-dev (2009-Jun-28)
Views 6.x-2.6
Observed the reported Error: handler for event > event_start doesn't exist!" when trying to convert my Views1 views.
I added the snippet and files suggested by #58 (Many thanks).
Disabled the Event Views module.
Disabled and re-enabled the event module and ran update.php.
Views1 views converted to Views2 and could be edited as expected.
Needed to reset the event start time fields in the views editor.
The live preview showed the correct information to be displayed as a block view.
The block views showed on the designated pages as desired.

MTecknology’s picture

Is the original issue still a problem or can we close this issue?

Niek_Kloots’s picture

Is the original issue still a problem or can we close this issue?

Yes because it still isn't an integrated part of the module but a patch.
After every new release one have to add the code from #13 and hope that the patch still works.

juanjo_dv’s picture

#58 works for me!
Thanks a lot.

I think this must be a priority and has to be bundled as a contribution to de Event module.

Start Date is the most important field while filtering events, i think, and I can't get it without this solution.

fnikola’s picture

Comment #58.

Step#2. I assume it means to place these 3 files in the event module directory.
Step#3. What does "List your modules under /admin/build/modules" mean?


Niek_Kloots’s picture

The files goes into your event module with the following names:

so skip the _.txt

Step#3 Go to and activate the modules

It works on my site

Keep a link to this page with you favorites because every time there is a new version for the events module you have at least to repeat coment 58 step #1

Unfortunely the maintainer(s) doesn't like to implement all of this in the event module.

agoel96’s picture

The file should be named

daigorocub’s picture

Just for the record, #58 worked for me but I needed the Arguments handler, so I made one.I tryed to use the date field handler already in the views module, but it didn't work.
I also altered the file.

Both files go to folder sites/all/modules/event.

Thanks and enjoy!

snipe’s picture

#58 works cool with D6.15, looking for arguments
trying #82

Thanks again

snipe’s picture

Okey... looks good
looking for year and month combination
will write something for it

cparrish817’s picture

#58 just saved my life.
Event 6.x-2.x-dev
Event-Views 6.x-2.x-dev
Drupal 6.15 (converted from Drupal 5.7)

narovi’s picture


crystaldawn’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

I've uploaded a new development snapshot that closes all of the drupal 6 / views API 2 problems. Closing all issues related to this problem.

niccottrell’s picture

About step #3 - activate which modules? I already had event and event views enabled. Should I see new module names appeared after the files are in place?

crystaldawn’s picture

This is no longer needed. DL the new release, unzip it, disable it, UNINSTALL IT (this is super important, dont miss this step), and then re-enable it and you'll be all set to go. There is however an issue with timezones not working, but for my implementations that didnt matter anyways. But I'll get that fixed up soon enough.