I have managed to get most of the different data sources to work, except for "Feeds source". It gives me the following warning, which reads more like an error:
--
warning: Illegal offset type in /mnt/stor1-wc2-dfw1/448523/450250/www.mysite.net/sites/all/modules/views/plugins/views_plugin_query_defaul... on line 97.

The following is all that I get:
--
Edit Export Clone
Feed node id: 1
Source: http://gdata.youtube.com/feeds/api/users/myuser/uploads?v=2
Custom text:
View result counter: 1

CommentFileSizeAuthor
#20 feeds-654466-20.patch2.36 KBcedarm
#19 feeds-654466.patch2.43 KBseanberto

Comments

dagmar’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +alpha-2 blocker

Please, can you export your view?

tesliana’s picture

$view = new view;
$view->name = 'fs';
$view->description = 'fs';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'feeds_source';
$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(
'feed_nid' => array(
'label' => 'Feed node id',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'set_precision' => FALSE,
'precision' => 0,
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
'id' => 'feed_nid',
'table' => 'feeds_source',
'field' => 'feed_nid',
'relationship' => 'none',
),
'config' => array(
'label' => 'Source',
'alter' => array(
'alter_text' => FALSE,
'text' => '',
'make_link' => FALSE,
'path' => '',
'alt' => '',
'link_class' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'trim' => FALSE,
'max_length' => '',
'word_boundary' => TRUE,
'ellipsis' => TRUE,
'strip_tags' => FALSE,
'html' => FALSE,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'exclude' => 0,
'id' => 'config',
'table' => 'feeds_source',
'field' => 'config',
'relationship' => 'none',
),
'nothing' => array(
'label' => 'Custom text',
'alter' => array(
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'exclude' => 0,
'id' => 'nothing',
'table' => 'views',
'field' => 'nothing',
'relationship' => 'none',
),
'counter' => array(
'label' => 'View result counter',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'counter_start' => '1',
'exclude' => 0,
'id' => 'counter',
'table' => 'views',
'field' => 'counter',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'fs');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));

dagmar’s picture

Project: Views (for Drupal 7) » Feeds
Version: 6.x-3.0-alpha1 » 6.x-1.x-dev

Sorry, you are using feeds to process your feeds, you should ask in this project.

alex_b’s picture

Category: bug » support

Support request.

alex_b’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closing after prolonged period of inactivity.

seanberto’s picture

I'm getting this same error, though in line 96 of views/includes/query.inc now.

Using: Feeds 6.x-1.0-beta3 with Views 6.x-2.11. Occurs whenever a "Feeds source: Source Source" field is added to the view.

The problem is that Feeds is passing $base_field as an array, resulting in the illegal offset error.

      $this->fields[$base_field] = array(
        'table' => $base_table,
        'field' => $base_field,
        'alias' => $base_field,
      );
seanberto’s picture

Status: Closed (fixed) » Active
seanberto’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta3
Category: support » bug
alex_b’s picture

Title: "Feeds source" problem » Views integration: feeds_source base field is an array, should be scalar

Hm, how then are we going to reflect the fact that the primary key is two fields in feeds_source ?

seanberto’s picture

I'm not a pro with Views at all, but looking at: http://drupalcontrib.org/api/function/hook_views_data/6, I'm assuming that $data['feeds_source']['table']['base']['field'] is supposed to be the primary key of the table, right?

But the view seems to work just fine and doesn't throw any errors if I change line 23 in feeds/views/feeds.views.inc from:

'field' => array('feed_nid', 'id'),

to:

'field' => 'feed_nid',

Am I missing something? (Probably ;) )

alex_b’s picture

Yeah, that's clear. Thing is that I *assume* that base field needs to be unique but 'feed_nid' nor 'id' are unique, while ['feed_nid' | 'id'] is.

seanberto’s picture

Again, not a pro, but I though that base field had to be the name of an actual column in your table. I'm curious to see what would happen if you just left base field blank, since you're not building any relationships that need the primary key.

Above my paygrade/skill level at this point. The change I made above works for my use case. I'm happy to test any patches that come from this. Thanks for all your work, alex_b, and please let me know how I can help!

alex_b’s picture

Just talked to some Views experts, here is what's going on:

Tables that should be Views base tables (feeds_source in this case) MUST have a primary key that consists of only one field, that's because base_field can be only one field and must be a PK.

This means that in order to fix this issue, we need to add an auto increment field (source_id I suggest) to the table and make it the PK instead of id | feed_nid. This is also the field that we will pass on to Views as base_field. #10 will break in cases where there is more then one $feed_nid. That's for instance when you use two standalone importers (not attached to nodes), both of their feed_nid would be 0.

seanberto’s picture

That makes senses. Thanks for the follow up and detailed explanation. I'll keep following this ticket and will test any patches that result from this. Again, please let me know if there's more that I can do. Sorry that I'm not a good enough developer to lend a bigger hand.

-Sean

alex_b’s picture

If you have any magic powers to send programmers this way, I'd appreciate it :-)

seanberto’s picture

Well, I should say that if all you need is a patch with a hook_update_N function written to add a new primary key field to the schema, I can do that...But I'm guessing this requires changing references to your current key all over the place. Right?

alex_b’s picture

But I'm guessing this requires changing references to your current key all over the place. Right?

Those references shouldn't be hard to track down, at least you could give it a try :)

seanberto’s picture

Okay. Will do. I'm on vacation next week (not that everyone on the forum needs to know...). The week after next I can this a try!

seanberto’s picture

Status: Active » Needs review
StatusFileSize
new2.43 KB

Okay, here's my first stab at the patch. Seems to be working for me, but admittedly I haven't done a ton of testing.

cedarm’s picture

StatusFileSize
new2.36 KB

Updated patch against 6.x CVS. Modified hook_schema() to match change. Also named the new pkey source_id instead of fid.

Is there a reason to add an index to replace the old primary key?

      'id_feed_nid' => array('id', 'feed_nid'),
twistor’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)
Issue tags: -alpha-2 blocker