Worked prior to upgrade to 2.9 and now stopped working. I only have 1 category.
see:
http://drupal.org/node/569700
SQL statement shown below:
SELECT aggregator_item.iid AS iid,
aggregator_item.title AS aggregator_item_title,
aggregator_item.link AS aggregator_item_link,
aggregator_item.description AS aggregator_item_description,
RAND() AS _random
FROM aggregator_item aggregator_item
LEFT JOIN aggregator_category_feed aggregator_category_feed ON aggregator_item.fid = aggregator_category_feed.fid
LEFT JOIN aggregator_category aggregator_category ON aggregator_category_feed.cid = aggregator_category.cid
WHERE aggregator_category.cid in ('1')
ORDER BY _random ASC
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | export.txt | 3.38 KB | akadimi |
Comments
Comment #1
merlinofchaos commentedPlease be more specific than 'stopped working'.
Please include an export of the simplest view you can provide that demonstrates this. Also if possible, a valuable one would be to provide a paste of the query that runs prior to the upgrade that works, and the query that runs after the upgrade that does not.
Comment #2
rkodrupal commentedViews Version 2.9 filter excludes all records, even the ones that are in the selected filter Aggregator category: Category ID = 1
Views Version 2.8 filter displayed records that were in the selected category ID = 1.
----------------------------------------------------
export from Views version 2.9 (with module views_ticker installed -- filter not working, i.e., all records are being excluded):
$view = new view; $view->name = 'wcrdaggregator'; $view->description = 'WCRD Aggregator'; $view->tag = ''; $view->view_php = ''; $view->base_table = 'aggregator_item'; $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' => '', '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, 'display_as_link' => 1, 'exclude' => 0, 'id' => 'title', 'table' => 'aggregator_item', 'field' => 'title', 'relationship' => 'none', ), 'description' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'target' => '', 'help' => '', 'trim' => 1, 'max_length' => '200', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'exclude' => 0, 'id' => 'description', 'table' => 'aggregator_item', 'field' => 'description', 'relationship' => 'none', ), )); $handler->override_option('sorts', array( 'random' => array( 'id' => 'random', 'table' => 'views', 'field' => 'random', ), )); $handler->override_option('filters', array( 'cid' => array( 'operator' => 'in', 'value' => array( '1' => '1', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'cid', 'table' => 'aggregator_category', 'field' => 'cid', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'none', )); $handler->override_option('cache', array( 'type' => 'none', )); $handler->override_option('use_ajax', TRUE); $handler->override_option('style_plugin', 'views_ticker_scroller'); $handler->override_option('style_options', array( 'scroller_type' => 'vertical', 'hscroller_speed' => '30', 'hscroller_direction' => 'left', 'hscroller_delay' => '0', 'hscroller_mouseover' => 0, 'hscroller_bounce' => 0, 'vscroller_speed' => '20', 'vscroller_direction' => 'up', 'vscroller_delay' => '2', 'vscroller_mouseover' => 0, 'vscroller_bounce' => 0, )); $handler = $view->new_display('block', 'Block', 'block_1'); $handler->override_option('block_description', 'Aggregator Ticker'); $handler->override_option('block_caching', -1);
------------------------------------------------------------------
export from Views version 2.8 (filters working, i.e., Category 1 items are being displayed). I only had an older version of the website with Views 2.8 installed, so it was missing the later-installed Views-Ticker module, and I needed to recreate the aggregator view. But 2.8 aggregator filter previously worked correctly with Views Ticker installed (as I recall).
$view = new view; $view->name = 'wcrdaggregator'; $view->description = 'wcrdaggregator'; $view->tag = ''; $view->view_php = ''; $view->base_table = 'aggregator_item'; $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' => '', '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, 'display_as_link' => 1, 'exclude' => 0, 'id' => 'title', 'table' => 'aggregator_item', 'field' => 'title', 'relationship' => 'none', 'override' => array( 'button' => 'Override', ), ), 'description' => array( 'label' => '', '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, 'exclude' => 0, 'id' => 'description', 'table' => 'aggregator_item', 'field' => 'description', 'relationship' => 'none', 'override' => array( 'button' => 'Override', ), ), )); $handler->override_option('sorts', array( 'random' => array( 'id' => 'random', 'table' => 'views', 'field' => 'random', ), )); $handler->override_option('filters', array( 'cid' => array( 'operator' => 'in', 'value' => array( '1' => '1', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'cid', 'table' => 'aggregator_category', 'field' => 'cid', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'none', )); $handler->override_option('cache', array( 'type' => 'none', )); $handler->override_option('use_ajax', TRUE); $handler = $view->new_display('block', 'Block', 'block_1'); $handler->override_option('block_description', 'Aggregator Ticker'); $handler->override_option('block_caching', -1);
----------------------------------------------------------------
Query from Views 2.8 with filters working (i.e., correctly selecting Category = 1 aggregator items)
SELECT aggregator_item.iid AS iid,
aggregator_item.title AS aggregator_item_title,
aggregator_item.link AS aggregator_item_link,
aggregator_item.description AS aggregator_item_description,
RAND() AS _random
FROM aggregator_item aggregator_item
LEFT JOIN aggregator_category_feed aggregator_category_feed ON aggregator_item.fid = aggregator_category_feed.fid
LEFT JOIN aggregator_category aggregator_category ON aggregator_category_feed.cid = aggregator_category.cid
WHERE aggregator_category.cid in ('1')
ORDER BY _random ASC
Let me know if you need more information.
Keith
Comment #3
dawehnerIsn't this fun?
I took the first sql statement in one file, and i took the second sql statement in another file
There is no difference between this two sql statements. I don't know why this should haved returned something before.
Comment #4
rkodrupal commentedone thing i've found with drupal is when you're having 'fun' you typically pop out the other end a little bit wiser.
yes i noticed the sql statements were the same, and the exports not much different with the exception of the views-ticker module components. the reason i assigned this bug to the views module is it is very similar to the filters behavior (or over-zealousness of behavior) i saw before application of the following patch to Views 2.8:
andagain.patch
found at http://drupal.org/node/748742 (#16).
before reporting this as a bug i verified (to the best of my visual acuity) that the andagain.patch was indeed committed to Views 2.9.
Keith
Comment #5
dawehnerNo i don't think so :)
The andagain patch was commited on drupal 7.x
Comment #6
merlinofchaos commentedWell, if the SQL is identitical, that's pretty close to the end of what Views is responsible for. I don't know why upgrading Views would affect how the same SQL is run on your database, but I have a feeling you're chasing a red herring at this point. If the SQL did not change, something *else* must have.
Comment #7
rkodrupal commentedred herring or not, the only modules that changed between filters working and now not working were Views and I18n, both due to security updates.
new information. the filter category ID <> 1 also does not work (results are empty).
does this help?
SELECT aggregator_item.iid AS iid,
aggregator_item.title AS aggregator_item_title,
aggregator_item.link AS aggregator_item_link,
aggregator_item.description AS aggregator_item_description,
RAND() AS _random
FROM aggregator_item aggregator_item
LEFT JOIN aggregator_category_feed aggregator_category_feed ON aggregator_item.fid = aggregator_category_feed.fid
LEFT JOIN aggregator_category aggregator_category ON aggregator_category_feed.cid = aggregator_category.cid
WHERE aggregator_category.cid not in ('1')
ORDER BY _random ASC
Keith
Comment #8
akadimi commentedHello
I'm having exactly the same error with drupal 6.17 and views 2.10, I can't filter on category ID.
SQL query:
Other filters are working normally, for example this SQL query is working for filtering on feed title:
Any help plz
--
Amine
Comment #9
akadimi commentedUpdate:
In fact, I think the bug is related to aggregator. I noticed these two different behaviors:
1. when the parent feed has been tagged with the chosen category: all items from the feed are returned by the filter whatever is the by-item category.
2. when no category is selected for the parent feed but categories are selected on a by-item basis: the filter does not return the items corresponding to the chosen category
After digging into the DB, I found a table called "aggregator_category_item" which references items to their categories. What's weird is that no mention to this table exist on the view's SQL query
Comment #10
akadimi commentedAny help on this error please, I opened an issue (#822692: View filter on item category ID not working) on the core queue but it was changed to views queue and marked as duplicate of this one, so it's surely related to views.
merlinofchaos, FYI this happened for me on a fresh install with only the views extra module installed
Comment #11
dawehner@محمد أمين
It would be cool if someone provides a real export of a view.
Comment #12
akadimi commentedHi,
I attached an export of the view. Thanks
--
Amine
Comment #13
brad.bulger commentedcomment #9 is to the point - invididual categorization is stored in aggregator_category_item and that table is not in the aggregator code for views. i downloaded views 2.0 and 3.x just to check, and it wasn't in either. so i'm not sure how this could have stopped working. it sure does not do what i was hoping it would do. i think, though, that the behavior described is what it's supposed to be doing.
the category info in the view is for the whole feed. if i assign the feed as a whole to a category, i can display it, use the category ID as an argument or a filter, and it is working fine. this is on 2.11.
being able to filter individual items the same way would be a new feature.
Comment #14
iamjon commentedTo the best of my knowledge this is a duplicate of #498438: Filter feeds by category uses wrong tables.
Please continue the discussion there.
Feel free to reopen if this is not infact a dupe.