Download & Extend

Make Aggregator feeds into entities

Project:Drupal core
Version:8.x-dev
Component:aggregator.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:D8MI, language-content

Issue Summary

I have tried my best to keep this patch as simple as possible. There is no functionality change. Only difference is that feeds became nodes.

AttachmentSizeStatusTest resultOperations
aggregator-feed-node.patch39.43 KBIdleFailed: Failed to apply patch.View details | Re-test

Comments

#1

Title:Make Aggregator feeds into first class Drupal nodes» Make Aggregator feeds into 1st class Drupal nodes

I have updated the patch.

Most of the tests are passing now.
OPML import is working.

AttachmentSizeStatusTest resultOperations
aggregator-feed-node-1.patch51.89 KBIdleFailed: Failed to apply patch.View details | Re-test

#2

Clean and nice! I'll test it soon.

#3

I tried to apply the patch but I got rejects. Should I reroll the patch or do you plan to do?

#4

Status:needs review» needs work

This changes every DB query in the Aggregator module. I think we should wait until DB:TNG patch gets committed.

#5

Great to see this one being tackled. #4: agree, let's wait until #302936: DB TNG: Convert aggregator.module queries is committed.

#6

This patch also depends on #303930: Pluggable architecture for aggregator.module. Once it is in, feeds as nodes is the next big priority for the aggregator revamp.

#7

Status:needs work» needs review

Rerolled after the DB:TNG and the pluggable patches.

AttachmentSizeStatusTest resultOperations
aggregator-feed-node-2.patch59.34 KBIdleFailed: Failed to apply patch.View details | Re-test

#8

Subscribing. This is neutral for code weight according to diffstat - although most of the new code is standard hook_* node implementations as opposed to maintaining custom storage.

Is the idea to move aggregator categories to taxonomy as a followup patch? Seems like much of the node hook implementations are for keeping track of categories, so I'd be interested to see if we could strip that out too.

#9

If we decide to drop the classic category stuff, i think the next problem is that the feed items are not nodes, so taxonomy system and classic aggregator items need to be connected somehow.
Taxonomy is basically for nodes. Is there any examples at Drupal core, where taxonomy is connected to some non-node stuff?
I'm really glad if we decide on taxonomy way, but maybe it won't be straightforward for the users. Let's hear the arguments pro and con :)

#10

In that case I reckon our best bet would be waiting for fields in core, and taxonomy as fields - then having aggregator items implement the field API (which should allow for attaching taxonomy vocabularies as fields). Either way, that puts it very much out of scope for this issue.

#11

We didn't really discuss taxonomy as a field. We do plan on having terms be 'fieldable objects' which means that one can attach custom fields to a term (e.g. picture). I would not recommend postponing this patch in favor of fields api.

#12

sub

#13

I think taxonomy as a field makes a lot of sense to me. It seems better to wait for fields in core, but then again, I don't like stalling important work.

#14

Reading my post again I think it's being read the opposite way to how it was meant. IMO this patch could go in as is - but when/if taxonomy becomes a field, we should revisit it again and convert 'categories' to use the taxonomy field - i.e. no need for that to be tackled in this patch.

#15

Status:needs review» needs work

Great to see this moving. There are several problems with this patch, though:

* It defines its own static node type, there is no way to create additional feed content types. This defeats one important purpose of feeds as nodes: configurable feed types. Aggregator should use a nodeapi hook to dynamically piggy back on any number of content types.
* This is related: feed settings need to go on the content type edit page so that we can create a different setting for every feed content type.
* The 'categorize' tab shows up even if there are no categories defined and the UI on node/x/categorize does not offer the possibility to create a new category. Ideally, either the category tab is hidden when there are no categories to choose from or there is a possibility to create categories on node/x/categorize.
* On a feed's node view, there is no possibility to update the feed's items.
* On a feed's node view, there is no link to a list of the feed's items.

I like that the patch doesn't load the feed node on cron. It would be expensive, it's not necessary for aggregator and if add-on modules need the feed node, they can load it with node_load($feed->nid);

I think that the category issue can and should be decoupled from the one at hand. It introduces a discussion that is actually independent from feeds as nodes. Should we create a new issue?

#16

I talked with Aron Novak about this and concluded that indeed feeds as nodes are a good idea. Most things you can do with a node are applicable to a feed: on a news site you might want to promote it (not just the items, the feed itself). You might want to attach an image (like a screenshot of the site you are following). Even an event could make sense if you are following, well, an event.

#17

Assigned to:Anonymous» alex_b

Working on #15 now

#18

This patch contains all important changes, works, but tests don't pass.

This is what's done:

* Feed records are linked to nodes
* Feed records don't contain neither title nor description - they live in node and node revision now.
* admin/content/aggregator/add/feed disappears
* Feed configuration moves from admin/content/aggregator/settings to the node type form
* node type form has 'feed content type' checkbox to activate the node type as a feed type.
* A feed lives on $node->feed. For back reference there is a $node->feed->nid, for convenience and performance there is a $node->feed->title in many cases.
* OPML creates feed nodes now.
* UI on aggregator/* adjusted
* Addresses all issues in #15

This is outstanding:

* Fix tests
* Improve UI on aggregator/* - we need a link from aggregator/sources/[id] back to node/[id] - don't know an elegant way yet.
* Validate URL on submission
* Test adding new fetchers, parsers, processors.
* More reviews

I'll be working again tomorrow on the list of outstanding items. Reviews in the meantime more than welcome.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch53.2 KBIdleFailed: Failed to apply patch.View details | Re-test

#19

* All tests working

Outstanding:

* Improve UI on aggregator/* - we need a link from aggregator/sources/[id] back to node/[id] - don't know an elegant way yet.
* Validate URL on submission
* Test adding new fetchers, parsers, processors.
* More reviews

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch67.43 KBIdleFailed: Failed to apply patch.View details | Re-test

#20

Rerolled patch, updated to latest changes.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch68.27 KBIdleFailed: Failed to apply patch.View details | Re-test

#21

I'd like to summarize why feeds as nodes are the way to go. Webchick and others have asked me to do so. The basic reasoning behind this patch is clearly missing from this thread, my apologies for overlooking this.

a) Feeds as nodes allow more than one type of feed (think ical, think rss/atom) on a single site by piggy-backing feed configuration on content type configurations. Look at http://drupal.org/project/feedapi to see how many types of aggregator plugins there are. Think for example: RSS, iCal, KML.
b) We get content type permissions and many more node related features for for free (see #16)
c) Feeds as nodes opens the door to using taxonomy on feeds and feed items (albeit with the downside of loosing per item categorization, this is why this is not included in this patch)
d) Feeds can be manipulated through nodeapi hooks.

#22

I am curious to know 2 things since I am deciding on either using Aggregator or FeedAPI for my Drupal 6 multisite setup.

1. The ability to discard feed items is valuable since I plan on running sub-sites and I would rather the user go to the sub-site to get their information as opposed to staying on my portal site. I only want the portal site to host the most recent info from the sub-sites.

2. I like how clicks to the feed headline redirects the user to the original article, the same with the "read more" link. I don't really want users to read the content as if it was on the portal site, I want them to get redirected to the sub-site.

The workflow would look like: Add feeds > Show feed teaser > Redirect to original article > delete article after X days/weeks.

Are these features planning on making it into the "Feeds as nodes" update? I hope they don't get discarded.

Thanks

#23

The ability to click on the title of the node teaser and be directed to the original article instead of the node is a good idea. I don't believe this is currently possible with feeds as nodes but should be.

#24

@specmav and SeanBannister. This patch is about having feeds as nodes, not indvidual feed items - so neither of those concerns are affected.

#25

Well, then I am a little confused about building "feeds as nodes" for a core module. Since using FeedAPI and its extended modules, you can achieve the same results.

What we (ehem..the developers) are doing is duplicating a perfectly good contrib module. What about the folks that just need a lightweight method of dealing with feeds? Granted, I am speaking for myself, but maybe there are others that looked at both FeedAPI and aggregator and found aggregator an easier and simpler approach.

I don't really want to get into a heated debate about it, but wouldn't there be a way for the module to "hijack" the headline output and alter the URL path on feed configured content types (if an option allows it)?

The deletion method could just be as simple as making sure aggregator for drupal 7 ships with the proper actions to allow an admin to set up a time limit to keep the nodes.

The nice thing about aggregator now is that it is a lightweight solution and if the need arises users can upgrade to FeedAPI for a more robust solution.

#26

specmav, I think you're misunderstanding what the patch does. This only makes feeds themselves into nodes - i.e. if I add http://drupal.org/rss.xml to my site as a feed, there'll be a node referencing the feed, with the URL, name, a description (and obviously whatever else you might want to stick onto a node type). What it doesn't do is change aggregator feed item storage - all the items which come from the Drupal front page will still be stored the same way as they were before, automatically expired, lightweight etc. etc.

#27

I think I am misunderstanding. I thought the purpose of this "feeds as nodes" patch was to place each feed item into it's own node.

Sorry it's late were I am and I had a brain fart.

#28

Oh sorry, kinda got side tracked by specmav's post :)

#29

Status:needs work» needs review

Changes:

* aggregator/sources is a page of node teasers now rather than a list of feed titles with the 3 latest feed items.
* Validates URL on submission
* Fixed block handling
* Fixed some minor UI issues.

This patch is ready for review now. Pay attention to what changed on the UI, especially how the aggregator/ pages flow and the way you configure a feed content type on the admin/build/types pages.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch76.3 KBIdleFailed: 9256 passes, 0 fails, 38 exceptionsView details | Re-test

#30

Status:needs review» needs work

The last submitted patch failed testing.

#31

Status:needs work» needs review

Oops, forgot to cvs add a new file (template for info on feed node pages).

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch77.69 KBIdleFailed: 9669 passes, 7 fails, 0 exceptionsView details | Re-test

#32

This revision brings back the full validation of feeds as we had them previously: check for duplicate URL, check for duplicate title. I will argue with a separate patch that we don't need this validation and that it doesn't scale, but let's go step by step.

An overview of the changes to Drupal core aggregator:

* To create a feed you create a node of a feed enabled content type.
* One feed content type is installed and configured automatically.
* Feed configuration is now per content-type.
* Feed fid is now nid and ties a feed record to a node.
* UI changes
** admin/content/aggregator/settings can now be found on a content type edit form.
** The UI on aggregator/sources had to change because feed node have their own pages (node/x). This page is not a list of feed titles with the three last feed items anymore, but a teaser list of nodes just like the front page of a vanilla Drupal install.
** Feed statistics moved from the top of aggregator/sources/X to node/X
** aggregator/sources/X holds a link to node/X
** Feed add form does not exist anymore, instead, there is a URL field on a node edit form.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch80.06 KBIdleFailed: Failed to install HEAD.View details | Re-test

#33

Small cleanups:

* On content type form, keep add on modules on their own spots in the form so that they show up in order.
* No module_invoke call to self in aggregator_processor_node_type_form()

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch80.27 KBIdleFailed: Failed to apply patch.View details | Re-test

#34

Status:needs review» needs work

The last submitted patch failed testing.

#35

Rerolled to reflect recent changes to core. Still needs work: I'd like to add an API test.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch80.89 KBIdleFailed: Failed to apply patch.View details | Re-test

#36

Assigned to:alex_b» Anonymous
Status:needs work» needs review

Added API tests, updated API documentation. Ready for review now.

For a summary of changes see #32. For "Why feeds as nodes?" see http://drupal.org/node/397748

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch92.76 KBIdleFailed: Failed to apply patch.View details | Re-test

#37

Status:needs review» needs work

I tried it out. It's nice that this patch is really solid now :)
I see some minor problems:

  • PHP notices are appearing at preview.
  • Feed node loses URL when doing a preview
  • aggregator/rss throws a PDOException. None of aggregator-related RSS feeds work.
  • Feed images seems to be problematic (does not work for me). I got broken feed image for example at that feed URL:http://downloads.bbc.co.uk/podcasts/radio4/yydisab/rss.xml . But this happens with all BBC feeds.

#38

Status:needs work» needs review

Here is the updated patch.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node_8.patch98.51 KBIdleFailed: Failed to apply patch.View details | Re-test

#39

Added following code to aggregator_form_opml_submit:

<?php
if (isset($form_state['values']['category'])) {
 
$edit['values']['feed']['category'] = $form_state['values']['category'];
}
$edit['values']['promote'] = '0';
?>

Page "aggregator/sources" was showing two pagers. Got rid of one of them by deleting following from aggregator_page_sources:

<?php
$build
['pager'] = array(
 
'#markup' => theme('pager', NULL, variable_get('default_nodes_main', 10)),
 
'#weight' => 5,
);
?>

Run coder over aggregator.

Imported near 1000 real feeds and run cron. No aggregator related errors happened.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node_9.patch96.08 KBIdleFailed: Failed to apply patch.View details | Re-test

#40

What will happen to feed nodes when uninstalling Aggregator?

#41

#40: when aggregator is uninstalled, feed nodes aren't deleted. Given the problems with deleting many nodes as once, I think that behavior is ok...

#42

That's the same as forum, book and any other module-provided content type in core, so not something which needs to be fixed here.

#43

I did a test run with Aggregator Node Processor and saw that the content type settings form swallowed node processor settings. Fixed.

Also removed the setting for how many items to show with every feed on /aggregator - this is obsolete now, as we show a list of feed node teasers on /aggregator now.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch99.01 KBIdleFailed: Failed to apply patch.View details | Re-test

#44

* Clarify node tab label: "Update feed" instead of "Update items".

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node.patch99.01 KBIdleFailed: Failed to apply patch.View details | Re-test

#45

The idea and the patch look very good to me. I've been giving it a try and everything seems to work fine. Also I've imported some OPML and it seems to work.

However, I think getting rid of aggregator categories should be also part of the same patch. Otherwise, once update scripts added, we are going to have first the ones to change the categories table, then the ones to get rid of it.

My question: isn't just easier to replace categories with taxonomy than changing these old categories bits to work with the nodes? Is there any reason why we want to still keep categories or do it on two steps/patches?

Some other tips:
- Why can't we have them under node revisions (vid) ?
- Now we have the full node workflow, we should refresh on cron only the ones that are set to published or maybe handle it some other way, but there should be some workflow for this.
- As these are now nodes, the node permissions should apply for feed listings.
- There could be more validation for the feed URL, i.e. checking that it is really a feed.

So as I've said, the patch looks great, works fine and these tips can be considered mostly new features. Just when we think of the final goal, will it be easier first committing this (with update scripts), then doing the 'get rid of categories' patch (with more update scripts) or doing all of it in the same patch?

#46

Status:needs review» needs work

Jose, thanks for review.

The category stack doesn't change much with this patch, so while it's very tempting to change them together with this patch, I really think we should keep it as a separate issue. The obvious solution would be to remove categories from aggregator altogether and to replace them by taxonomy. Taxonomy will support categorization on a feed level, but not on a feed item level. I personally don't care about this limitation, but that might be a controversial issue that I'd rather leave out of the feeds as nodes discussion. I updated an existing issue accordingly: #15266: Replace aggregator category system with taxonomy

"Now we have the full node workflow, we should refresh on cron only the ones that are set to published" - I wanted to do this for FeedAPI but there was some serious and reasonable push back on this. I think published/unpublished shouldn't be coupled with refreshing/not refreshing on cron. #19646: Aggregator: Feed Suspend Option

Node revisions... good idea. Let me think about this. URL validation: separate issue.

These are the issues I'm seeing that need to be addressed with this patch:

* Respect node permissions
* Write update hooks for schema changes

#47

#45 - using vid for tying aggregator to node table (enabling revisions on the aggregator table) is an excellent idea. I don't see any problems with it, we should do it.

#48

For the taxonomy change - assuming it goes in in a followup patch, we could rip out the category updates introduced with this patch since HEAD to HEAD updates aren't supported (if that's feasible given the upgrade path).

#49

we could rip out the category updates introduced with this patch since HEAD to HEAD updates aren't supported (if that's feasible given the upgrade path).

catch, not sure whether I understand your point 100%: I'd say we can always patch an update() function that updates from HEAD to HEAD. So I would leave any category changes in this patch (they are minor, mostly changing fid to nid) to keep aggregator fully functional after this patch. Later, if people agree on #15266: Replace aggregator category system with taxonomy we can patch core in a way so that we don't wind up with converting things in one update hook, then removing them in a subsequent update hook.

#50

alex_b - yeah taht's what I meant. Thanks for re-opening #15266: Replace aggregator category system with taxonomy.

#51

Status:needs work» needs review

Here is a new version.
Revision support (for both aggregator_feed and aggregator_category_feed tables)
Test class for revision support
aggregator/sources/%node path respect node permissions.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node_with_revisions.patch103.43 KBIdleFailed: 10756 passes, 24 fails, 146 exceptionsView details | Re-test

#52

Status:needs review» needs work

The last submitted patch failed testing.

#53

Status:needs work» needs review

I messed up the test module under /tests/ at the last patch.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node_with_revisions.patch100.31 KBIdleFailed: 10744 passes, 0 fails, 92 exceptionsView details | Re-test

#54

Status:needs review» needs work

The last submitted patch failed testing.

#55

Status:needs work» needs review

The test in #53 failed because of aggregator-feed-info.tpl.php and changes to test module missing. This patch should pass.

Reviewing now.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node_with_revisions.patch104.21 KBIdleFailed: Failed to apply patch.View details | Re-test

#56

Just went through the code and did a bunch of small fixes and added an update hook for upgrading the schema. This is looking very good. We need more reviews now to get this to RTBC.

Fixes:

  • Respect versions when updating aggregator_feed after parsing.
  • Show feed items on aggregator/sources/[nid] when node is unpublished but hide link back to node.
  • Add update hook for converting DB schema.
  • Clean up language in revisioning test.
  • Filter URL on display in feed-info.tpl.php
  • Remove aggregator_feed_load() - not used anymore.
AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node_with_revisions.patch106.45 KBIdleFailed: Failed to apply patch.View details | Re-test

#57

I haven't followed this closely enough to know whether anything specific should be tested, but the patch works like a charm.
Creating a feed via node/add and using revisions shows no problems at all.

#58

Status:needs review» needs work

Just looking through the patch, some minor things, mostly related to DBTNG

+  if (@is_object($node->feed) && user_access('administer news feeds')) {

Can't you use isset() && is_object() instead ? @ is ugly and slow...

+function hook_node_delete_revision($node) {
+  db_delete('aggregator_feed')->condition('vid', $node->vid)->execute();
+  db_delete('aggregator_category_feed')->condition('vid', $node->vid)->execute();
+}

These should be converted to multi-line calls.

+  $nids = pager_query(db_rewrite_sql('SELECT n.nid FROM {node} n INNER JOIN {aggregator_feed} f ON f.vid = n.vid WHERE n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10))->fetchCol();

- That query needs to be converted to a dynamic db_select() query with addTag('node_access') and ->extend('PagerDefault'). See http://drupal.org/files/issues/blog_dbtng_conversion3.patch for an example.

#59

Status:needs work» needs review

#58 berdir: thanks for your review. This patch takes care of all of your points.

I also added creating a content type when updating from previous aggregator versions. I ran into a problem where field_attach_create_bundle() is not loaded when creating a content type in hook_update(). Apply #439236: field_attach_create_bundle() undefined when creating a content type on hook_update() for testing hook_update of this patch.

AttachmentSizeStatusTest resultOperations
293318_aggregator_feed_node_with_revisions.patch106.98 KBIdleFailed: Failed to apply patch.View details | Re-test

#60

Status:needs review» needs work

It works great, very nice work.

The only thing.. I don't really understand why it creates a content type when enabled and it doesn't define it with _node_info() like blog.module. Also there's this variable in install script seems not to be used: variable_set('aggregator_enabled_feed', TRUE);

About the upgrade script, what happens with existing feeds? I mean I see no nodes being created for existing old feeds. Btw, this whole script would be much easier if you rename old table, create new one and run some INSERT/SELECT, which btw would preserve old data just in case (existing content type, script doesn't complete, etc...)

I've tried the coder module on the code, it just throws these two:
- aggregator.install: severity: normal Line -1: @file block missing (Drupal Docs)
- aggregator.test: Line 567: String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms... $this->drupalPost('node/'. $feed->nid .'/revisions/'. $vids[0] .'/revert', array(), 'Revert');
(plus there's some bad indenting on aggregator.install line 342

#61

Status:needs work» needs review

#60: Thanks for review, Jose.

- Fixed code style issue in test. Left out @file block issue in .install file - not related to this patch.
- Rerolled to reflect renaming of drupal_execute() to drupal_form_submit()

Are content migrations required in Drupal major version updates? Eek, looking at other modules I'm afraid so :P

The variable from variable_set('aggregator_enabled_feed', TRUE) is used e. g. in aggregator_form_alter() with variable_get('aggregator_enabled_' . $form['type']['#value'], FALSE) - that's why you couldn't grep it...

The reasoning behind not providing a hard coded content type is that you may want to be able to remove the content type and replace it by another one (and it is perfectly possible to do so). The patch is not following the example of blog module, but rather node module or book module: even the book content type can be removed now.

Still requires #439236: field_attach_create_bundle() undefined when creating a content type on hook_update() to update successfully - am I doing anything wrong when creating the content type in aggregator_update_7001() ?

AttachmentSizeStatusTest resultOperations
293318-61_aggregator_feeds_as_nodes.patch107 KBIdleFailed: Failed to apply patch.View details | Re-test

#62

Status:needs review» needs work

- needs content upgrade path
- catch situation when a content type 'feed' already exists

#63

This needs to be rerolled. Here's the chunk that was rejected. I'm willing to reroll it but know how to do that exactly.

Looks like the part that wouldn't patch is just ripping out aggregator_form_feed(), along with its submit and validate functions, as well as one little node_load() line.

AttachmentSizeStatusTest resultOperations
aggregator.admin_.inc_.rej_.txt6.77 KBIgnored: Check issue status.NoneNone

#64

Is this right?

AttachmentSizeStatusTest resultOperations
293316-64-aggregator-feeds-as-nodes.patch105.59 KBIdleFailed: Failed to apply patch.View details | Re-test

#65

Assigned to:Anonymous» alex_b

#64 akahn: you're missing aggregator-feed-info.tpl.php which is a new file. Check out tools like cvsdo to add new files to a repository that you don't have write permissions to.

Rerolled to reflect recent changes to aggregator. I'm going to work on the changes outlined in #60 and #61 now.

AttachmentSizeStatusTest resultOperations
293318-65_aggregator_feeds_as_nodes.patch106.85 KBIdleFailed: Failed to apply patch.View details | Re-test

#66

Assigned to:alex_b» Anonymous
Status:needs work» needs review

Changes:

- On installation/update make sure a feed content type is created by iterating until a type name is found that is not taken.
- Implemented hook_requirements() and warn user if there is no feed content type available.
- Implemented conversion for existing feeds to feed nodes. This is not tested.
- Changed back functionality of aggregator_save_feed() to include a call to aggregator_processor_save_feed_category(). This makes more sense as aggregator_save_feed() should be the single entry point for storing a $node->feed object. This also reflects closer the existing functionality of aggregator_save_feed().

Todo:

- Make feeds to feed nodes a batch operation. This conversion can take a long time.
- Test conversion.

Setting to needs review to get the test bot working on this. I'd also really love some more eyes on this, as this work is getting a lot closer to finalization now.

AttachmentSizeStatusTest resultOperations
293318-66_aggregator_feeds_as_nodes.patch108.19 KBIdleFailed: Failed to apply patch.View details | Re-test

#67

Status:needs review» needs work

The update doesn't work: I get the following error message which disrupts the update process:

An error occurred.
Path: http://localhost/drupalupdatetest/update.php?id=2&op=do
Message: PDOException: INSERT INTO {node_type} (type, name, base, has_title, title_label, has_body, body_label, description, help, min_word_count, custom, modified, locked, orig_type) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13) -
Array
(
[:db_insert_placeholder_0] => feed
[:db_insert_placeholder_1] => Feed
[:db_insert_placeholder_2] => node_content
[:db_insert_placeholder_3] => 1
[:db_insert_placeholder_4] => Title
[:db_insert_placeholder_5] => 1
[:db_insert_placeholder_6] => Body
[:db_insert_placeholder_7] => A feed can be used to download syndicated content like RSS or Atom feeds to your web site.
[:db_insert_placeholder_8] =>
[:db_insert_placeholder_9] => 0
[:db_insert_placeholder_10] => 1
[:db_insert_placeholder_11] => 1
[:db_insert_placeholder_12] => 0
[:db_insert_placeholder_13] => feed
)
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base' in 'field list' in node_type_save() (line 593 of /srv/www/htdocs/drupalupdatetest/modules/node/node.module).

The error page I am then led to says:

The update process was aborted prematurely while running update #7001 in aggregator.module. All errors have been logged. You may need to check the watchdog database table manually.

#68

Status:needs work» needs review

- Reflect recent changes to aggregator
- Fixed #67
- Tested conversion in aggregator_update_7001()

Apply [##439236] when testing update.

Outstanding:

- Conversion to nodes needs to be batched.

AttachmentSizeStatusTest resultOperations
293318-68_aggregator_feeds_as_nodes.patch108.37 KBIdleFailed: 11082 passes, 377 fails, 184 exceptionsView details | Re-test

#69

Status:needs review» needs work

The last submitted patch failed testing.

#70

Assigned to:Anonymous» alex_b
Status:needs work» needs review

Resolve recent conflicts. Working on batching now.

AttachmentSizeStatusTest resultOperations
293318-70_aggregator_feeds_as_nodes.patch107.81 KBIdleFailed: Failed to apply patch.View details | Re-test

#71

Assigned to:alex_b» Anonymous

- Update hook uses batch API now.

All issues brought up above are now addressed. Further reviews and feedback more than welcome.

Apply #439236: field_attach_create_bundle() undefined when creating a content type on hook_update() when testing update.

AttachmentSizeStatusTest resultOperations
293318-71_aggregator_feeds_as_nodes.patch108.78 KBIdleFailed: 11316 passes, 3 fails, 0 exceptionsView details | Re-test

#72

Status:needs review» needs work

I was about to RTBC but + // $this->assertEqual(count(array_diff($parsed, $processed)), 0, t('Found stored results from processing stage.'));
this looks strange. Why is this commented out? Also, if you want to see something being 0 use assertFalse simply: $this->assertFalse(array_diff($parsed, $processed), t('Found stored results from processing stage.')) You can even try $this->assertTrue($parsed == $processed, t('Found stored results from processing stage.')) if that's appropriate.

#73

Status:needs work» needs review

#73: Thank you for review. This is fixed.

The assertion tests whether the processing stage yields the feed items that the test pseudo feed contains. It's using an assertEqual rather than an assertFalse because it more accurately reflects what we are looking for: a difference of 0 between the results of parsing and processing stage.

AttachmentSizeStatusTest resultOperations
293318-73_aggregator_feeds_as_nodes.patch108.69 KBIdleFailed: 11318 passes, 3 fails, 0 exceptionsView details | Re-test

#74

Status:needs review» reviewed & tested by the community

I think this is ready -- let's see what others say :)

#75

Status:reviewed & tested by the community» needs work

The last submitted patch failed testing.

#76

Status:needs work» needs review

Rerolled to reflect recent changes by #220233: Put node_get_types() out of its misery and #480102: Update aggregator module to use drupal_static().

AttachmentSizeStatusTest resultOperations
293318-76_aggregator_feeds_as_nodes.patch108.84 KBIdlePassed: 11640 passes, 0 fails, 0 exceptionsView details | Re-test

#77

Status:needs review» reviewed & tested by the community

Test bot did its work, setting back to RTBC now.

#79

Coder generated this warning:

aggregator.module
  * Line 270: Use ANSI standard <> instead of !=
AttachmentSizeStatusTest resultOperations
293318-78_aggregator_feeds_as_nodes.patch105.6 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 293318-78_aggregator_feeds_as_nodes.patch.View details | Re-test

#80

Status:reviewed & tested by the community» needs work

While I support feeds as nodes, this can only be an interim step. It is way too rough around the edges especially around usability and easy of use. We need to take another pass at this with end-user usability in mind. Needs quite a bit more work ...

  1. For non-technical end-users, I think the node form is a regression for setting up feeds. A couple of problems:
    • The node form does too much when all you want to do is add a simple feed. The vertical tabs are completely unnecessary in this case (Mark and Leisa's design would solve this by moving it under 'Meta').
    • It made more sense to have the add feed form on admin/content/aggregator/add/feed than to have it under "create content". Sorry, but it is the truth.
  2. The default node view for feed items is also a regression:
    • It shows the user that created the feed as the author.
    • Showing the date as we do now doesn't make sense either.
    • The node page is pretty empty therefore confusing. After creating a feed, people probably expect to see the feed's news items, not an empty node page. It would be better to show the feed items.
    • The "Update feed" and "Remove items" tab are odd. It might be better that we remove those and let people do these kind of operations on the admin overview page.
  3. The feed page that shows the news items shows: " Feed: feed name" which is redundant. The feed name is already shown above as the title of the page.
  4. $node->feed->nid, $feed_node->feed->url, $node->feed->title seems like inproper use of the name space. If feeds are nodes, we should use $feed->nid, $feed->title, $feed->url, etc. The current nesting is messy and not developer friendly.

#81

Hm. Yes, the user interface changes do represent a net loss in simplicity...

Would an alternative to this approach be to make aggregator feeds first-class fieldable entities of their own right, so that you could attach things to them such as parsers and validators?

#82

Just a question (without testing) - to address dries concerns, do the feeds themselves really need to be nodes? Why not use nodes for feed items?

#83

Version:7.x-dev» 8.x-dev

#84

Whats the status of this issue? I would be happy to reroll a patch for this if there is still a chance to have it go into D7?

#85

This won't go into D7.

#86

Status:needs work» needs review

#79: 293318-78_aggregator_feeds_as_nodes.patch queued for re-testing.

sorry i never meant to do that :(

#87

Status:needs review» needs work

The last submitted patch, 293318-78_aggregator_feeds_as_nodes.patch, failed testing.

#88

Tagging for Drupal 8 multilingual initiative.

#89

In Drupal 6, it was possible to set up feeds that saved into their own data tables using Feeds + Data modules. Additionally, since feeds were nodes, they could have taxonomy terms, etc. attached.

In Drupal 7, the Data module looks like it may disappear, and the core Aggregator module has been improved. The "categories" included in the core Aggregator module are useful, but I would love the ability to attach fields to Aggregator feeds.

Rather than making feeds nodes, wouldn't it be possible (via hook_entity_info(), etc.) to make Aggregator module feeds "fieldable"? Each feed category could be a bundle, and then users could attach their own fields (in my case, taxonomy_term_reference fields) to feeds, which would make Aggregator much more useful and flexible.

I'm still getting familiar with the Field Attach API - but from what I know now, this doesn't sound like it would be very hard to implement.

#90

Title:Make Aggregator feeds into 1st class Drupal nodes» Make Aggregator feeds into entities

Yep, these should almost definitely be entities, re-titling.

#91

Because of my needs (posted above), and since I assume no new features will make it into the core Aggregator module at least until Drupal 8.x, I decided to create a module (for Drupal 7) that expands the core Aggregator module in a number of ways to make it more scalable. It makes feeds fieldable, uses pagination on the admin/config/services/aggregator page, allows bulk deletion of feeds, provides a log of "bad" HTTP status codes and parse errors encountered (and a new parser & fetcher to help fill this table), a utility to check all current feed URLs on the site (via Batch API), and extra Views integration, along with a utility to let current users of the Feeds module migrate their data to use Aggregator instead.

I realize that not all these features are relevant to this thread, but, if nothing else, the module contains the code needed to make Aggregator feeds fieldable and could lighten the load of someone looking to patch the Aggregator module. I also think the other changes (mentioned above) are necessary to provide scalability and flexibility and should be considered as core features in future versions of Aggregator.

Also, in the above post, I'd suggested that categories could be bundles - but this doesn't make sense the way they're currently treated (a feed can belong to multiple categories, and categories can be changed via checkboxes on the feed edit page at any time). So for now, I exposed one bundle, just called "aggregator_feed," to which all Aggregator feeds belong. Perhaps in the future, categories should become fixed bundles and the type of information categories currently represent could be taken over by user-defined Fields.

This is my first contribution - so it's a sandbox project right now, but the URL is http://drupal.org/sandbox/nkschaefer/1216400 and my full project application is here: http://drupal.org/node/1216496.

Thanks - and I hope this helps get the ball rolling.

#92

Tagging for the content handling leg of D8MI.

#93

Issue tags:+language-content

Ha, it helps if I do it.