Call to undefined function views_build_view()
konsumer - March 15, 2008 - 18:05
| Project: | Services |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | snelson |
| Status: | closed |
Description
View service doesn't seem to work in drupal 6.

#1
As an offical release for views does yet exist for drupal 6 (alpha doesn't count) no work will be done on porting this service until this changes
#2
I've bumped into this problem myself. Is this still an issue?
#3
This patch fixes the views.getView function to work in D6. If someone will verify that this works, I'll commit it.
Scott
#4
#5
I am new to Drupal but not to PHP.
Where do I put this code?
#6
It's a patch, so the easiest way is to install GNU patch, (already installed on mac and linux) save the file in the module dir, then from that dir issue this command:
patch -p0 < views_service_get_view.patchSome IDE's have an interface for this, too (I know eclipse does)
The patch file has this format (if you want to apply it manually, or just understand how to read it):
These 2 lines show what file is to be edited
--- services/views_service/views_service.module+++ services/views_service/views_service.module
This means "find this stuff on line 82"
@@ -82,12 +82,15 @@ function views_service_service() {These means "subtract these lines from the --- file (above) and add these lines"
- $result = views_build_view('result', $view, $args);- while ($node = db_fetch_object($result['result'])) {
+ $view->set_arguments($args);
+ $view->execute();
+
+ foreach ($view->result as $node) {
#7
Against which file needs the patch to be applied?
#8
I had to manually apply patch (copy and paste code), but it seemed to work for me.
#9
Thanks Scott!
#10
Automatically closed -- issue fixed for two weeks with no activity.