Download & Extend

Call to undefined function views_build_view()

Project:Services
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:snelson
Status:closed (fixed)

Issue Summary

View service doesn't seem to work in drupal 6.

Comments

#1

Status:active» postponed

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

Status:postponed» needs review

This patch fixes the views.getView function to work in D6. If someone will verify that this works, I'll commit it.

Scott

AttachmentSizeStatusTest resultOperations
views_service_get_view.patch797 bytesIgnored: Check issue status.NoneNone

#4

Assigned to:Anonymous» snelson

#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.patch

Some 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

Status:needs review» fixed

Thanks Scott!

#10

Status:fixed» closed (fixed)

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

#11

I guess this is still an issue?
I get that error - I guess the php code I got from another thread is for drupal 5, or an older Views

I had stable release and tonight also trued viwes 6.x-3.x-dev

The pacth doesnt seem to work I cant find anything like views_service??

nobody click here