I used the feeds module to import some rss feeds into a data table. One of the fields in this data table was 'feed_nid' (the feed is attached to a node). I had a view that displayed information from this feed data that queried the data table directly. However, I needed more information available to the view, specifically some information from the node that the feed was attached to. To accomplish this I user the Data UI to alter the data table and add a join to node_revisions.nid onto the feed_nid column. It worked.

However, I now wish to alter this join, but am unable to do so. If I click on the join, and then select another field from another table in the select list and click save I get a message stating "Updated join information." however, the join has not changed and still references "node_revisions.nid".

I am able to alter the join from a Left join to an Inner join. But, not if I try to change the join field at the same time.

Comments

mrfelton’s picture

Also, I tried deleting that field completely and then recreating it. I deleted the field, and created a new one with the same name as the old one - feed_nid. As soon as I created the field again, it already had the the join from before on it!

mrfelton’s picture

This is interesting... looking at the data in MySQL directly - notice how the field seems to have several joins - each one corresponding to one of my attempts to alter the join. So it appears that instead of altering the existing join, it is actually adding a new one?

Table schema

a:4:{s:6:"fields";a:7:{s:2:"id";a:4:{s:4:"type";s:6:"serial";s:4:"size";s:6:"normal";s:8:"unsigned";b:1;s:8:"not null";b:1;}s:5:"title";a:3:{s:4:"type";s:7:"varchar";s:4:"size";s:6:"normal";s:6:"length";i:255;}s:11:"description";a:2:{s:4:"type";s:4:"text";s:4:"size";s:6:"normal";}s:9:"timestamp";a:3:{s:4:"type";s:7:"varchar";s:6:"length";i:255;s:8:"not null";b:0;}s:4:"guid";a:2:{s:4:"type";s:4:"text";s:4:"size";s:6:"normal";}s:3:"url";a:2:{s:4:"type";s:4:"text";s:4:"size";s:6:"normal";}s:8:"feed_nid";a:3:{s:4:"type";s:3:"int";s:4:"size";s:6:"normal";s:8:"unsigned";b:0;}}s:7:"indexes";a:5:{s:8:"feed_nid";a:1:{i:0;s:8:"feed_nid";}s:2:"id";a:1:{i:0;s:2:"id";}s:9:"timestamp";a:1:{i:0;s:9:"timestamp";}s:4:"guid";a:1:{i:0;a:2:{i:0;s:4:"guid";i:1;i:255;}}s:3:"url";a:1:{i:0;a:2:{i:0;s:3:"url";i:1;i:255;}}}s:11:"primary key";a:1:{i:0;s:2:"id";}s:4:"name";s:38:"feeds_data_drupal_project_release_feed";}

Table meta

a:2:{s:6:"fields";a:7:{s:5:"title";a:6:{s:5:"label";s:5:"Title";s:19:"views_field_handler";s:19:"views_handler_field";s:20:"views_filter_handler";s:27:"views_handler_filter_string";s:22:"views_argument_handler";s:29:"views_handler_argument_string";s:18:"views_sort_handler";s:18:"views_handler_sort";s:6:"search";i:0;}s:11:"description";a:6:{s:5:"label";s:11:"Description";s:19:"views_field_handler";s:19:"views_handler_field";s:20:"views_filter_handler";s:27:"views_handler_filter_string";s:22:"views_argument_handler";s:22:"views_handler_argument";s:18:"views_sort_handler";s:18:"views_handler_sort";s:6:"search";i:0;}s:4:"guid";a:6:{s:5:"label";s:0:"";s:19:"views_field_handler";s:19:"views_handler_field";s:20:"views_filter_handler";s:27:"views_handler_filter_string";s:22:"views_argument_handler";s:22:"views_handler_argument";s:18:"views_sort_handler";s:18:"views_handler_sort";s:6:"search";i:0;}s:3:"url";a:6:{s:5:"label";s:3:"URL";s:19:"views_field_handler";s:23:"views_handler_field_url";s:20:"views_filter_handler";s:27:"views_handler_filter_string";s:22:"views_argument_handler";s:22:"views_handler_argument";s:18:"views_sort_handler";s:18:"views_handler_sort";s:6:"search";i:0;}s:8:"feed_nid";a:6:{s:5:"label";s:0:"";s:19:"views_field_handler";s:27:"views_handler_field_numeric";s:20:"views_filter_handler";s:28:"views_handler_filter_numeric";s:22:"views_argument_handler";s:30:"views_handler_argument_numeric";s:18:"views_sort_handler";s:18:"views_handler_sort";s:6:"search";i:1;}s:2:"id";a:6:{s:5:"label";s:0:"";s:19:"views_field_handler";s:27:"views_handler_field_numeric";s:20:"views_filter_handler";s:28:"views_handler_filter_numeric";s:22:"views_argument_handler";s:30:"views_handler_argument_numeric";s:18:"views_sort_handler";s:18:"views_handler_sort";s:6:"search";i:0;}s:9:"timestamp";a:6:{s:5:"label";s:0:"";s:19:"views_field_handler";s:24:"views_handler_field_date";s:20:"views_filter_handler";s:25:"views_handler_filter_date";s:22:"views_argument_handler";s:27:"views_handler_argument_date";s:18:"views_sort_handler";s:23:"views_handler_sort_date";s:6:"search";i:0;}}s:4:"join";a:3:{s:14:"node_revisions";a:3:{s:10:"left_field";s:3:"nid";s:5:"field";s:8:"feed_nid";s:10:"inner_join";s:1:"1";}s:16:"project_projects";a:3:{s:10:"left_field";s:3:"nid";s:5:"field";s:8:"feed_nid";s:10:"inner_join";s:1:"0";}s:23:"node_comment_statistics";a:3:{s:10:"left_field";s:3:"nid";s:5:"field";s:8:"feed_nid";s:10:"inner_join";s:1:"0";}}}
mrfelton’s picture

And just to confirm, by manually altering the serialized table meta data and removing all the joins, I was then able to create a new join to the table/field I wanted.

patcon’s picture

I think this issue has lead to my problem with exportables:
#963002: Adding a join and then removing it leads to buggy inclusion of empty join array in exported feature

The fix is simply a matter of removing a line from the *.data_default.inc file of the feature, but very troublesome if you don't know where to look!

acouch’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Active » Reviewed & tested by the community
StatusFileSize
new614 bytes

This is still an issue in 7.x. The problem was that the join meta array just kept getting added to and never truncated. This caused new entries to be added to the data_tables and most likely exported as indicated #963002: Adding a join and then removing it leads to buggy inclusion of empty join array in exported feature but not read. Attached is a patch.

acouch’s picture

Status: Reviewed & tested by the community » Needs review

Oops. Wrong status.

jerry’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Working fine here. Let's RTBC it.

  • joachim committed 640b6ab on 7.x-1.x authored by acouch
    Issue #639606 by acouch: Fixed joins can't be removed or altered.
    
joachim’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone!

Status: Fixed » Closed (fixed)

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