When I clear the cache, I get this error on every page:

Fatal error: Class 'views_handler_argument_date' not found in [webroot]\sites\all\modules\date\date\date_views.inc on line 53

Changing the weights of either module to make one come before the other doesn't appear to help. Visiting Administer > Build > Views appears to fix the problem.

CommentFileSizeAuthor
#21 date.views_.inc_.gz11.55 KBsmscat

Comments

karens’s picture

Those functions are on the same page (I created a date argument that I was going to offer to Views as a patch, so I am using the views prefix even though it's in the date_views file), so the load order isn't an issue, but the fact that the class is declared before its dependency might be the problem if you're using PHP 4.

Or it may be a caching issue if it was resolved when you went to administer>build>views.

Once you visited administer>build>views it stayed fixed, is that right?

I haven't run into this myself anywhere, so I'm fishing for an idea.

fractile81’s picture

Title: Load Order Problem? » Class 'views_handler_argument_date' not found

I'm using PHP 5.2, and it has only appeared to happen after the cache was cleared. And yeah, once I go to Administer > Build > Views, it all clears up.

I can't seem to reproduce this problem right now, though (just updated Views, not sure if that's really where the problem lies). I did try moving the class to the end of the date_views.inc file, but I can't reliably reproduce the problem right now so I'm not sure if its a fix. I'll see if I can't verify this move as a fix if I can get the error to show up again.

fractile81’s picture

I was able to find a way to reproduce the problem, so here are some extra findings:

  • I disable the Date module, and the error goes away.
  • Moving the classes around did no good (just wanted to make sure).
  • cron.php was having this problem as well (it also happens that I'm calling this from the command-line rather than a browser right now, but I'm not sure if that's relevant).

I tried to hunt down the class, and found that all of the views handlers can be loaded with views_include_handlers();. Adding this to the top of the date_views.inc file appears to fix this problem. I still don't know what causes this problem, however.

I'm not sure if this is a problem with Date or Views, but wanted to toss this solution out to see what people think.

karens’s picture

Status: Active » Fixed

Ahah! You found the right answer. I need views_include_handlers() at the top of the page to be sure all the classes get initiated. I'm 99% sure that's the problem.

Thanks! I'll tentatively mark this fixed -- hoping that it really is :)

merlinofchaos’s picture

KarenS:

If you rename date_views.inc to date.views.inc and then remove all references to the file, Views will automatically include the file when necessary. Then this kind of thing won't happen, and you will also know that you aren't loading Views code when Views isn't being used.

najibx’s picture

Version: 6.x-1.0-beta » 6.x-1.x-dev

Hi,
I am using 6.x-1.x-dev 2008-May-05. The problem still persist.
I used PHP 5.2.3.

alf nif’s picture

Status: Closed (won't fix) » Fixed

same here, sorry for duplicate entry earlier. I've tried with the renaming from merlinofchaos.

I use PHP 5.2.1

alf nif’s picture

Status: Fixed » Closed (won't fix)

I tried to uninstall both Date and Views modules and reinstall them and still not working.

danyell’s picture

Status: Fixed » Closed (won't fix)

I was able to eliminate this error with:

cd BLABLA/module/date
mv date/* .

(In non-linuxese: go to date module directory, move contents of .../date/date into .../date)

I think 6.x-1.0-beta may have a bad tarball directory structure?

japanjill’s picture

I tried all of the above and have not been able to successfully install the date module. If I delete it, everything is fine. On reinstall, I get the views_handler_argument_date not found error.

I did notice that if I was on the following page, /admin/settings/date-time, installed date, and then refreshed the page, the time zone drop down went from actual times to time zone names. Additionally, the time zone drop down was highlighted because the value was then empty. And, the following text appeared in the error message box at the top of the page.

* An illegal choice has been detected. Please contact the site administrator.
* warning: timezone_open() [function.timezone-open]: Unknown or bad timezone (-25200) in /nfs/kodak3/ki33/wwwudev/world/research/drupal/sites/all/modules/date/date_api.module on line 552.
* warning: date_create() expects parameter 2 to be DateTimeZone, boolean given in /nfs/kodak3/ki33/wwwudev/world/research/drupal/sites/all/modules/date/date_api.module on line 555.
* warning: date_offset_get() expects parameter 1 to be DateTime, boolean given in /nfs/kodak3/ki33/wwwudev/world/research/drupal/sites/all/modules/date/date_timezone/date_timezone.module on line 90.

If I then remove the date director under modules and refresh the page, the default timezone field highlights with another error - and the contents switch back to actual times "Tuesday, May 13, 2008...", instead of timezone names "USA/Pacific."

I also noticed the following "Important Notice" on the date project page:
Version 2 of the Event module is currently incompatible with the Date API, since the Event module has a different method for setting site and user timezones that keeps the Date API from working correctly. The Date Copy module has a conversion program to convert Event fields to Date fields, if you want to switch to using Date and Calendar.

However, to the best of my knowledge, I have not installed or enabled the Event module.

karens’s picture

Can you list the steps to reproduce this? I can't replicate it.

Is this a clean install or an update?

Harpreet Singh’s picture

I'm having the same problem on the Live-Site (FreeBSD). Locally (windows xp, xampp) works fine. Patching with views_include_handlers(); has no effect.

Now' I've deactivated the whole date module, but the problem still occurs.

happy

alf nif’s picture

I've tried the latest build of date of it and I noticed that you've renamed the class we're discussing to "views_handler_argument_date2"... other from that, still error when activating Views

ghankstef’s picture

I can reproduce this with View Beta 3, Php 5.2.1 and Date 6.x.1_dev I had to delete the date module directory to get past the problem

Anonymous’s picture

Version: 6.x-1.x-dev » 6.x-2.0-beta

views_include_handlers(); has no effect.
I tried moving all of the files as per suggestion above, but no effect.

Class date_views_argument_handler: Cannot inherit from undefined class views_handler_argument_date2 in /home/blahblah/public_html/modules/date/date.views.inc on line 49

Views B3

Every thing but 'date' and 'date copy' can be enabled, the error specifically comes when I enable 'date' though, the other is dependent on it.

No other suggestions?

Anonymous’s picture

Status: Closed (won't fix) » Postponed (maintainer needs more info)
charlesc’s picture

I installed the 6.x-2.0-beta(2008-May-23) and got this error message:

Fatal error: Class 'views_handler_argument_date2' not found in D:\TWPD\Apache\htdocs\nc\sites\all\modules\date\date\date.views.inc on line 49

karens’s picture

Status: Postponed (maintainer needs more info) » Fixed

Update to the latest -dev code with today's commits (you can get it today from cvs or tomorrow in the tarball) and make sure to pick up the 6.2 branch instead of 6.1. There are changes since the beta version that should take care of this.

jasontanner’s picture

Whenever I try to enable the Date module, even using the 6.x-2.x-dev (2008-Jun-05) version of Date (and views B3) I still get this error:

Fatal error: Class 'views_handler_argument_date2' not found in .../drupal6/sites/all/modules/date/date/date.views.inc on line 49<

I have tried clearing the views cache, tried deleting the Date module directory and reinstalling. and tried adding views_include_handlers(); to the .inc file as suggested above.

I dont have the event module installed.

Kind of at a loss on what else to try.

jasontanner’s picture

Status: Fixed » Postponed (maintainer needs more info)
smscat’s picture

StatusFileSize
new11.55 KB

Fatal error: Class 'views_handler_argument_date2' not found in .../drupal6/sites/all/modules/date/date/date.views.inc on

I has a same problem on my hosting. but on my own computer there were no such problem.

I has fix it by moving 3 Classes (counting from second) in file /sites/all/modules/date/date/date.views.inc to the end of this file. (see attachment)

To my mind problem was apeared because php interpreter parsed file only onse (is it an optimization option?). After I make file strength parsable the problem desapeared.

imagetag’s picture

Got the same error. I did a search on the whole module directory and the class "views_handler_argument_date", which should be extended didn't exist. Could it be that you are using a non-released version of views? I'm using the latest builds for date, calendar, views, etc.

The date.views.inc isn't part of your latest package, so I assume, that you're views already include the date enhancements, I read about them in the cvs, but afaik, they're not relased in any package, even no dev.

Thanks alot.

imagetag’s picture

MMh, more info. I could try to describe my thoughts a lil bit more detailed, or at least try to :)

The Date module was kind of working on my site. Had some errors but it worked. My main problem was, that the views had a problem with content related date fields, while node related seemed to work quite well. Well I've seen your latest dev's and hopefully installed them. But I came across the missing class error as described above. Like the others here I tried to move, rename, include the handlers, moved classed around, but without any success.

The line which spits out the error ist :

class date_api_argument_handler extends views_handler_argument_date { ...

So I wanted to look at the class views_handler_argument_date, you try to extend. I searched via my Zend Framework through the whole module dir, and there is no class definition of views_handler_argument_date anywhere. That's why the extension failed and therefor I assumed you're maybe using a dev version of views.

I don't know if this was any helpful, but it didn't harm anyway.

imagetag’s picture

P.S. If I change views_handler_argument_date to views_handler_argument_numeric again, the error disappears and the site comes up again, but I haven't tested any date function with this change....

choster’s picture

Same solution as post #21 posted at http://drupal.org/node/267968 , which I've marked as duplicate.

imagetag’s picture

The solution is outdated. It's based on date_api.views.inc,v 1.1.2.3, but I'm talking about date_api.views.inc,v 1.1.4.4. The version in the file posted above hasn't even the line class date_api_argument_handler extends views_handler_argument_date {...

Maybe the wrong file found its way into the dev? I don't know.

After changing the extended class from ..._date to ..._numeric as mentioned above, my site seems to run error free, but no dates were shown in the calendar and the "current date" feature disappeared. Last point isn't a real problem since I provided a return argument via a php default value. Otoh the missing dates are quite unfortunate :).

Thanks again.

choster’s picture

Marked http://drupal.org/node/268951 as a duplicate, reporting this error on line 97 of date_api.views.inc with date-6x-2dev with views-6.x-2.0-beta3.

imagetag’s picture

For all the people with the same problem.

It seems that you need to have the latest argument.handlers.inc from the views cvs installed. I can't say yet if this file is the only needed file from the views repository, but I got no errors left so far.

@Karen
If I'm right, maybe the readme in the dev should include a note, that this latest Dev only works with the latest views files.

karens’s picture

Yes, you need the latest Views -dev code. A new date argument was added to views. I've also made other changes to the latest date -dev and Calendar -dev that you'll need.

The general rule (at least until Views, CCK, Date and Calendar have official releases) is that you'll always need to bump up to the latest code for all of them if you find things that don't work. Everything involved is still beta quality and changing continuously.

imagetag’s picture

Sounds absolutely logical to me. I think I would have tried that much earlier, if views already had another dev release in the meantime.

The main reason, why I posted the last comment was simply, that it seemed to me, that at least a dozen people got the same error like me and most probably the half of them are stucked with the views beta, which is weeks old.

So, I think I'm a quite experienced programmer, but pretty new to drupal, so like many other newbies in here, I make some usual newbie mistakes, that's why I think a note like, "Please be sure to use the latest revisions of all related modules, before posting any error..." would do no harm.

Thanks for your response and your encouraged work. I hope that I need to use Drupal long enough, to make some useful contribution to the community, too.

patrickharris’s picture

What's the easiest way of downloading views head/dev? Does anyone have a link?

choster’s picture

@patrickharris, the development snapshots are stored in CVS, see http://drupal.org/node/321 for instructions (if the instructions are too scary, I advise waiting until the next official release to download). Also, please do not use the issue queue for questions unrelated to resolving this specific issue.

karens’s picture

Status: Postponed (maintainer needs more info) » Fixed

I just released a new 6.2-beta2 version for Date, so update to the latest code for Date and also get the latest -dev version of the Views module, which has some date-related changes that are needed for the Date views handling. If you use the Calendar module, get the new 6.2-beta2 version of that as well.

If you still have problems after that, open a new issue marked with the beta2 version so I know it's still a problem there.

patrickharris’s picture

@choster - thanks for that. I've been using tortoise to check out cvs - I was just wanting to make sure there wasn't an easier way. If I have any more OT thoughts, I'll make sure to PM you directly.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.