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

CommentFileSizeAuthor
#3 views_service_get_view.patch797 bytessnelson

Comments

marcingy’s picture

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

scottym-1’s picture

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

snelson’s picture

Status: Postponed » Needs review
StatusFileSize
new797 bytes

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

Scott

snelson’s picture

Assigned: Unassigned » snelson
greenskunk’s picture

I am new to Drupal but not to PHP.

Where do I put this code?

konsumer’s picture

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) {
rapsli’s picture

Against which file needs the patch to be applied?

clarke.hackworth@gmail.com’s picture

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

robloach’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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

allan1015’s picture

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