When using the date API with views, I keep getting an error:
* warning: class_exists() expects parameter 1 to be string, array given in /sites/all/modules/views/includes/handlers.inc on line 17.
* warning: class_exists() expects parameter 1 to be string, array given in /sites/all/modules/views/includes/handlers.inc on line 37.
* warning: Illegal offset type in isset or empty in /sites/all/modules/views/includes/handlers.inc on line 120.
* warning: class_exists() expects parameter 1 to be string, array given in /sites/all/modules/views/includes/handlers.inc on line 81.
If I remove all the date related fields, sorts, filters, then the error goes away. So I can only assume this has to do with the date module. Has anyone else experienced this? I'm unable to display a list of date events without seeing these warnings.
Comments
Comment #1
cerup commentedI've found that this error only happens when I use the date filter or argument in views. If I set the date to filter on 'now' it creates the error above. The same thing occurs if using a date argument. Currently I have no way to filter a view and show only dates from now and the future without recieving a 'class_exists' error.
Any thoughts on this?
Comment #2
Michal Zochowski commentedHi, is the issue you are describing similar to http://drupal.org/node/784084 ?
Comment #3
cerup commentedNot quite Michal.
My issue is that using a date filter OR date argument causes the following errors to get printed (drupal_set_message) on the page the view is displaying.
I currently have no way to filter a view of only events that are upcoming without getting the errors.
Comment #4
beifler commentedI'm having the same issue. Disabling Date fixes the problem. Help please.
Comment #5
cerup commentedI still haven't figured this out either and am unable to use filter by date. Do you get the exact same error?
Comment #6
beifler commentedYes, it's the exact same, except (perhaps it's like this for you) it repeats many times. I am totally unable to use filters or arguments with date. Does anyone else have this issue? Question for maintainer: do you think this is NOT a date issue, but a problem with another module's interaction? I got this error after upgrading Drupal to the latest code base (6.16)-Edit-Whoops, I meant 6.17.
Comment #7
cerup commentedI'm assuming it's a conflict with another module, but I'm unable to figure it out also. I'm using 6.14 drupal. So it wouldn't be a 6.16 issue it seems.
Comment #8
cerup commentedbeifler, have you gotten anywhere with this?
I just upgraded from Druapl 6.15 to 6.17 and the issue still remains for me.
I'm out of thoughts at this point and I can't use date module due to this issue. It would be great to get thoughts from other people using this module with/without issue.
Comment #9
beifler commentedI was hoping you did ;) I'm going to test it on a new site and see if the issue continues. If it works, the next step is to make a development version of my production site and disable modules one by one, possibly uninstalling one by one as well until it starts to work again. If you get to it before me, let me know what causes the error! (And I'll do the same)
Comment #10
ea777 commentedI'm having the same issue. Whenever I use a date filter, I get PHP errors. I get
"Fatal error: Call to a member function use_count_query() on a non-object drupal"
when I try to use an exposed date filter.
Comment #11
cerup commentedbeifler, yeah I may at the same point of disabling all modules one by one. Let me know your results (you'll probably get to test before I do). beifler, if you want - send me a message with a list of your modules and I can compare with mine to see if there's overlap. Might be a quicker way to debug.
ea777, it sounds like it may be a different issue as it's not the same error. Although, it's hard to say for sure.
Comment #12
karens commentedI can't reproduce this in the latest code. I fixed a few bugs and maybe this got fixed at the same time. Please try again with the latest code (either a fresh -dev checkout from cvs or wait for tomorrow's -dev tarball).
Comment #13
cerup commentedAfter going through and turning on/off various modules, I found that a custom module of mine that uses views was conflicting for unknown reasons.
This does not appear to be a Date module issue and therefore can be mark closed.
beifler, I recommend going through and see if another module is conflicting as I imagine it's probably an error in another module causing this (which was the case for me).
Comment #14
cerup commentedComment #15
beifler commentedThanks for the update cerup, it sounds like I have a similar problem and finding the conflicting module will fix it.
Comment #16
jvieille commentedI have the same errors when a calendar block is displayed.
Cerup, Beifler could you please name the conflicting modules.
I have 200 modules enabled, it will take ages for me to discover the culprit.
Thanks
Comment #17
cerup commentedThe conflicting module for me was one of my own custom modules. So that won't help you too much.
Comment #18
davidbm commentedIn my case it was something related to the table wizard module. I disabled the node table to be managed with tw and the error went away.
Comment #19
naushunaushad commentedI think this is related to Date module.I faced this problem after upgrading from Drupal 6.19 to 6.2
Any way I found a solution to solve this problem.
Use the following code in views\includes\handlers.inc on line 17
if(is_array($definition['handler'])){
$definition['handler']='views_plugin_display_default';
}
I am not sure this is the right way.But if you want to eliminate the error then you can use this
Comment #20
dkinzer commentedI started seeing something exactly like this. The reason for me is that I'm trying to override the views_file_size_handler. But instead of overriding it, Views merges my class with it's own into an array. I'm creating an issue in the Views issue queue to address this type of situation.
Update:
I just noticed what it is. Looks like there might not be a way to do what I want which is to override an already set field.
I'm passing :
in my module, which because it's already defined in the Views module, I guess merges Views definition with my own. The only solution I see is to define my own field. Not as pretty as what I wanted to do but at least I wont get the error.
Update - 2:
Yeah, so what happened was that I introduced a bug by returning the above data def from a hook_views_data(), instead of altering the bits I needed using hook_views_data_alter(&$data):
#801694-4: warning: class_exists() expects parameter 1 to be string error - How to override a views handler
Comment #21
jshimota01 commentedHi - wanted to comment in support of seeing this in the TW module. I too get:
warning: class_exists() expects parameter 1 to be string, array given in E:\wamp\www\sites\all\modules\views\includes\handlers.inc on line 17.
warning: class_exists() expects parameter 1 to be string, array given in E:\wamp\www\sites\all\modules\views\includes\handlers.inc on line 37.
warning: Illegal offset type in isset or empty in E:\wamp\www\sites\all\modules\views\includes\handlers.inc on line 120.
warning: class_exists() expects parameter 1 to be string, array given in E:\wamp\www\sites\all\modules\views\includes\handlers.inc on line 81.
The configuration that was working for a year and a half was a 6.15 core with 15 add-on modules and some very minor customizations. The client asked me to 'make it green' ie; get all the modules uptodate for security purposes and I happily duped it to a development site and moved it to 6.20 - then the errors were there. I redid the work, step by step (6.20 upgrade with all other modules upgraded including date, views and schema modules) I isolated that if I left the TW module non-updated I got no errors. Only after applying the (table wizard) TW module update to this version did I get the problem. I also tried with the last non-devoplement version of the TW module, and the same problem occurs with it as well.
As TW was noted as being deprecated in favor of the Data module I'm at a quandry now about how to move forward.
And I now apologize, this post is in a closed bug marked as fixed. hmmm.
More info I'd like to share. Went back to my working 6.15 environ, and updated TW only. It failed saying Date module blah blah. Did the Date module first - no errors. then did the TW module. It failed with the above error. I'm convinced that what I've read about it being Date module related holds true since many if not all the referenced failures seem to have date functions involved. Google shows many sites with this error recently (searched "includes/handlers.inc on line 17"). I can't find true fix, code or patch that solves this and I want to since its a pre-step for 7.0 upgrade. Can anyone direct me towards a solve?
Comment #22
CraigBertrand commentedDisabling Table Wizard fixed it for me too.