Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Views lets you create views from templates now. We need to have a template for each available date field to easily create a calendar for that field.
This will make it possible to create a new calendar at any time for any date field, and will allow us to quit using default views for that purpose.
Comment | File | Size | Author |
---|---|---|---|
#2 | Views | Date Test Site-1.jpg | 62.06 KB | KarenS |
Views | Date Test Site.jpg | 26.92 KB | KarenS |
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedThis has been committed.
Comment #2
KarenS CreditAttribution: KarenS commentedWhen clicking on the option to create a view from a template, you now see something like this. Click 'Add' next to one of them to create the view:
Comment #3
arlinsandbulte CreditAttribution: arlinsandbulte commentedAfter the commit that added this feature, I get the following error when I click on the option to create a view from a template:
Note: the undefined function date_views_fields() *IS* found in the file: date_views.views.inc line 145.
This is on a fresh D7.10 site
Ctools: 7.x-1.0-rc1.110-dev
Views: 7.x-3.1.17-dev
Date: 7.x-2.0-rc1.69-dev
Calendar: 7.x-3.0-alpha2.4-dev
(Note the new -dev release number notation from #1314180: Make dev release numbers useful)
Comment #4
KarenS CreditAttribution: KarenS commentedI can't replicate any problem, they work fine for me. But that function is in an .inc file and maybe there are some times when it isn't loaded in time. I tried moving it to the .module file. See if that helps.
http://drupalcode.org/project/date.git/commit/587af42
Comment #5
arlinsandbulte CreditAttribution: arlinsandbulte commentedHmmm very strange... after pulling the latest from git (all required modules) I not get a new undefined function error:
I am going to completely tear-down and build from scratch & supply more info & a step-by-step shortly.
Comment #6
arlinsandbulte CreditAttribution: arlinsandbulte commentedStep-by-step instructions to reproduce the problem:
Here is a list of my site configuration info (using the quickstart VM):
Database system: MySQL, MariaDB, or equivalent
Database system version: 5.1.54-1ubuntu4-log
PHP: 5.3.5-1ubuntu7.4
Web server: Apache/2.2.17 (Ubuntu)
[EDIT] After all the above steps I did the following:
This is really strange....
Comment #7
KarenS CreditAttribution: KarenS commentedJust out of curiosity, see what happens when you try to use the default template that comes with views (there is an image gallery template). Do you get an error with that? If so, this may be a bug in the Views template system. I already ran into one small issue with that, and I don't think it's been used much so errors haven't been bled out of it yet.
Also see if clearing the cache and trying again does anything.
Comment #8
arlinsandbulte CreditAttribution: arlinsandbulte commentedCross-post during my edit: see my edit in #6 above regarding clearing the cache.
Regarding the default template that comes with views, that seems ok so long as calendar is not enabled (which causes the WSOD & error message when clicking on the link).
Comment #9
arlinsandbulte CreditAttribution: arlinsandbulte commentedAll of my work so far has been done on my local machine using the Quickstart VM on my windows laptop.
I am now going to try reproducing this on my dreamhost server (using a sub-domain).
Comment #10
KarenS CreditAttribution: KarenS commentedI'm guessing this is something to do with using this on a site that has no date fields. Try creating a date field and see if things work right then.
Comment #11
arlinsandbulte CreditAttribution: arlinsandbulte commentedI thought the same before and I think I tried that, but still got the error... but I will verify again.
Comment #12
KarenS CreditAttribution: KarenS commentedWorks fine for me on existing site, but I haven't tried a new install yet, so I'll try that now and see if I can figure out what would be different.
Comment #13
arlinsandbulte CreditAttribution: arlinsandbulte commentedFresh install on my dreamhost server failed with same error.
I followed the steps in #5, but I added a date field to the article content type before step #12.
Maybe I need some content (nodes)... trying that now:
Nope, adding an article node does not solve the problem.
Comment #14
KarenS CreditAttribution: KarenS commentedIt's tripping on this code in date_views.fields.inc:
The message is as though the views module does not exist, even though we're doing this in views. The function it cannot find, _views_prepare_handler(), seems not to be available at this point.
I haven't found the magic thing that makes it start working, but I can assure you it works fine on another site with lots of views and fields. This is really odd.
Comment #15
arlinsandbulte CreditAttribution: arlinsandbulte commentedWell, at least we know the problem is reproducible. That is 90% of the battle....
Comment #16
arlinsandbulte CreditAttribution: arlinsandbulte commentedUpdating title to make it easier to search for & find.
Also, the views issue KarenS mentioned in #7 is #1411478: Notice when saving a View created from a template
BUT, I am not sure that is directly related to this issue, as this one creates a WSOD before creating the view and that one deals with saving the new view.
Comment #17
jide CreditAttribution: jide commentedI encountered the same error while updating from alpha2 to latest dev. After disabling APC and restarting the server, the error went away.
EDIT: and after enabled APC again, still no error...
Comment #18
jide CreditAttribution: jide commentedHum okay, must have done something too fast.
The error still shows up at every call to update.php one time, and after I refresh the page, everything is fine.
Would be interesting if you could reproduce : Try to update any module that has database updates, and run update.php.
Comment #19
arlinsandbulte CreditAttribution: arlinsandbulte commentedI had a similar experience when clearing the cache, see the #6 edit.
Comment #20
KarenS CreditAttribution: KarenS commentedThe code that causes the problems is trying to find all the core date fields (like node posted date) so we can create templates for them as well as Field date fields. I have to use views functions to identify those, and those are the functions that are failing. I think if I just pull that out and only create templates for Date fields that will fix this problem (because I can easily find those fields without using the Views API). That will leave us without templates for other fields, but I guess that is just the way it will have to work.
I don't have time to do this right now, I have to get on a plane and will be en route most of the day. So I'll have to get back to this later.
Comment #21
dhalbert CreditAttribution: dhalbert commentedThis was also complained about in a Views issue: #1413200: undefined function _views_prepare_handler(). A Views maintainer came up with a fix, so perhaps it's not really something that needs to be fixed in Calendar.
Comment #22
arlinsandbulte CreditAttribution: arlinsandbulte commentedI will test this with the updated views code and report back when I get the chance... time for bed now.
Comment #23
arlinsandbulte CreditAttribution: arlinsandbulte commentedLooks like #1413200: undefined function _views_prepare_handler() fixed this issue. I no longer get an error with the latest Views code.
Thanks dhalbert!
Comment #25
rajmataj CreditAttribution: rajmataj commentedHave a basic site with no content yet. Have activated:
...and all was working well. However, when I activated the Calendar 7.x-3.0-rc1 module, received this error on a white screen:
Only way to get around was to press the back button and disable the Calendar 7.x-3.0-rc1 module in the modules list. Any help would be appreciated. Thanks.
Comment #26
jide CreditAttribution: jide commented@rajmataj: The issue is fixed in 7.x-3.x-dev. See #1413200: undefined function _views_prepare_handler().
Comment #27
loopy1492 CreditAttribution: loopy1492 commentedReplacing my views.module with the one from the dev release seems to have fixed this problem. It also seems to have fixed a 500 error I was getting when refreshing my cache.
I'll keep an eye on it and let you know what happens.
Comment #28
loopy1492 CreditAttribution: loopy1492 commentedThis resolution is looking very promising. All errors have stopped. I'll let it sit and run until next week before I make a final verdict.
Comment #29
webengr CreditAttribution: webengr commentedconfirm,
...Call to undefined function _views_prepare_handler()....
I also saw this error on feb 17, 2010 when trying to update.php to rc1, and googled to this page.
I changed views module from 7.x-3.1 2012-Jan-16 to the dev, 7.x-3.x-dev 2012-Feb17
and then when I ran update with the Feb 14 date and calendar module updates I did not get that error.
reckon the update was based upon dev views not stable.
Comment #30
PESTO3567 CreditAttribution: PESTO3567 commentedI just had the same problem here. The fix is easy, you have to reset the calander view and do your customization again, thats it.
UPDATE: Well, I can clear the cache sometimes ...and sometimes not. There's still something serious wrong and broken!
Comment #31
arlinsandbulte CreditAttribution: arlinsandbulte commented#30:
Did you try the latest -dev version of Views?
This *IS* fixed in views, that is what I confirmed in #23 above.
Comment #32
deryck.henson CreditAttribution: deryck.henson commentedMaybe I'm doing something horribly wrong, but after upgrading to calendar 3.x-dev AND views 3.x-dev, WSOD is all I get no matter what page it is (dev versions as of today).
And I'm not sure how any of you even got to the template page. This occurs right after I hit "enable". Even update.php gets WSOD treatment, like #18 and #19 experienced.
Drupal 7.12
Views 3.x-dev
Calendar 3.x-dev
Comment #33
arlinsandbulte CreditAttribution: arlinsandbulte commented#32 is a different error not related to this issue.
It is, however, a duplicate of this one: #1441244: Fatal error: Call to undefined function date_views_base_tables, which states you need the latest -dev of the DATE module too.
Comment #34
deryck.henson CreditAttribution: deryck.henson commentedGood looks, that fixed it. Thanks.
Comment #35
nickgrace CreditAttribution: nickgrace commentedMany thanks. Updating to the latest dev versions of Views and Date resolved the error for me.
Comment #36
michaelrajchandra CreditAttribution: michaelrajchandra commentedYou said you fixed it but how is it possible to update when all you can see is Fatal error: Call to undefined function date_views_base_tables() in /home/user/public_html/sites/all/modules/calendar/includes/calendar.views.inc on line 18
No page is visible
Please help asap I am stuck
Comment #37
arlinsandbulte CreditAttribution: arlinsandbulte commented@ZaDeveloper:
Are you trying to use the drupal web interface to update? If so, yes, you might be unable to do so if something is causing a fatal error on your website.
So, instead of using the web interface to update, you must use ftp.
Or if you are a more advanced administrator, you can use the command line, ssh, and/or drush. But ftp is the easiest to start with.
Follow the instructions here: http://drupal.org/node/672472
You will not be able to log onto your drupal site and put it into maintenance mode, but that's ok.
Comment #38
michaelrajchandra CreditAttribution: michaelrajchandra commented@ arlinsandbulte
Thanks for your prompt reply...
Yes I was trying to use the drupal web interface to update and it failed with the Fatal Error.
"Fatal error: Call to undefined function date_views_base_tables() in E:\UCDC Site\sites\all\modules\calendar\includes\calendar.views.inc on line 18"
On your suggestion I used ftp and uploaded the latest Dev version of Date module and overwrote the existing files and folders and it worked like magic...
Thanks again for taking the time out to help...
Comment #39
batigolixconfirming that updating to the latest version fixes the problem: