I'm not sure what the issue is as I have poured over the code myself and can't find anything. After upgrading to the newest views dev release, the Views Datasource module stops working.

Now, if I go in to edit a view I created previous to the update and using this module, it says "Missing style plugin" in the style area of the view.

If I try to view the result of the view, I get the following error:

Fatal error: Call to a member function uses_fields() on a non-object in /bla/public_html/sites/default/modules/views/includes/view.inc on line 556

A bit of help would be greatly appreciated! Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zmove’s picture

Same error here, with the new views RC2.

Any help would be appreciated.

zmove’s picture

Priority: Normal » Critical

I think it can be considered as critical.

jkopel’s picture

I am pretty sure it is the result of this http://www.angrydonuts.com/attention-views-api-developers
I have been trying to figure out how to fix this myself, but I am not having much success.

no2e’s picture

Is this moulde still under active development? Last release is from July :| Would love to see a new release with this bug fixed.

JaceRider’s picture

I will say that I was able to get things working. It's a mess of code right now -- but I got it working at least. :) I'll give things a little longer and if no updates are made to this module, I may throw my own version together and get it up for the rest of you guys.

zmove’s picture

Any news about a possible patch ?

JaceRider’s picture

FileSize
27.05 KB

Alright guys,

Here is a fixed version I threw together. Obviously I cannot offer any support for this. Also, this is not a patch as the fixes required several filename changes.

I have only tested the XML and JSON modules, but the rest should work as well.

First, uninstall the modules from the Admin Module page, then simply delete your existing views_datasource folder and unzip the attached folder in its place and re-enable the modules of your choice. It is no longer required that all modules be enabled for things to work.

oriol.rico’s picture

Hello, but i couldn't save the XML option with this datasource. All the other options is ok, but Drupal don't save XML option :P

Could you help me?

Thanks

Oriol

jozzhart’s picture

FileSize
26.13 KB

It was missing xml_plugin_style.inc, i've included it here...........

GuillaumeDuveau’s picture

Check that, the dev is still active and he says there's an alpha 3 coming : http://groups.drupal.org/node/11387
But I checked the HEAD code and it's an older version than alpha 2 :(
Thanks Jozzhart I guess your version is the latest working one :)

Ujval Shah’s picture

FileSize
445.37 KB
66.26 KB

Hi Dude,

I am using:
(1) views - views 6.x-2.2
(2) views_datasource (provided in the comment-9 by jozzhart on current node,http://drupal.org/node/307223)

I have created a view, and set it to "Style: XML data document". For the same view i have given a path as sitemap.xml, i am able to see the result but it is showing me the message as "This XML file does not appear to have any style information associated with it. The document tree is shown below."

Here is the my created view:

/********************************************/

$view = new view;
$view->name = 'xml_views';
$view->description = 'xml_views';
$view->tag = 'xml_views';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'changed' => array(
'label' => '',
'date_format' => 'medium',
'custom_date_format' => '',
'exclude' => 0,
'id' => 'changed',
'table' => 'node',
'field' => 'changed',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('filters', array(
'type' => array(
'operator' => 'in',
'value' => array(
'page' => 'page',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('style_plugin', 'views_xml');
$handler->override_option('style_options', array(
'schema' => 'raw',
));
$handler->override_option('row_plugin', 'unformatted');
$handler->override_option('row_options', array(
'separator' => '|',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'sitemap.xml');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));

/*************************************************************************/

The result i am able to see is in the first-attachment (current.png).
I am looking for the result which is provided in the attached screen-shot (required.png).

Your help would be appreciated.

Thanks,
Drupal Rocking

emackn’s picture

Still broken?

aaron’s picture

Status: Active » Reviewed & tested by the community

#9 works fine for me. can someone commit it?

aaron’s picture

kyle_mathews’s picture

Just tried installing #9 and it's broken (again). The error I'm given is "The row plugin is not of type Unformatted."

I'm running 6.x-2.6.

gausarts’s picture

subscribing for updates. Thanks

hchall’s picture

Also eager to see this module work with Views 2.
(Drupal 6.13, Views 6.x-2.6, Views Datasource 6.x-1.0-alpha2)
Thanks for the effort!

allisterbeharry’s picture

Status: Reviewed & tested by the community » Fixed
allisterbeharry’s picture

Assigned: Unassigned » allisterbeharry

Status: Fixed » Closed (fixed)

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