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

marcingy - March 15, 2008 - 23:03
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

scottym - March 26, 2008 - 08:49

I've bumped into this problem myself. Is this still an issue?

#3

snelson - April 12, 2008 - 07:23
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

AttachmentSize
views_service_get_view.patch 797 bytes

#4

snelson - April 12, 2008 - 07:36
Assigned to:Anonymous» snelson

#5

GreenSkunk - April 15, 2008 - 16:49

I am new to Drupal but not to PHP.

Where do I put this code?

#6

konsumer - April 17, 2008 - 17:41

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

rapsli - May 16, 2008 - 13:41

Against which file needs the patch to be applied?

#8

clarke.hackworth - May 23, 2008 - 18:40

I had to manually apply patch (copy and paste code), but it seemed to work for me.

#9

Rob Loach - May 24, 2008 - 08:17
Status:needs review» fixed

Thanks Scott!

#10

Anonymous (not verified) - June 7, 2008 - 08:23
Status:fixed» closed

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

#11

allan1015 - October 28, 2009 - 07:04

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??

 
 

Drupal is a registered trademark of Dries Buytaert.