Notice: Undefined property: stdClass::$title in feeds_node_validate() (line 608 of /vagrant/web/sites/all/modules/contrib/feeds/feeds.module).

This notice occurs when the Zotero feed is first created. As the notice message itself notes, it occurs in Feeds' node validation hook, and it appears to be a bug in Feeds to expect a title property on the node object before the node has been saved once.

Once the feed node is created, additional imports do not display this notice.

Comments

mlncn created an issue. See original summary.

mlncn’s picture

Title: Notice about title when running feeds import » Notice about title when creating feed node (which then runs feeds import for the first time)
Project: Biblio Zotero » Feeds
Issue summary: View changes

Tentatively moving this to the Feeds queue (surprised there isn't a similar issue already) and seeing if i get righteously told off.

megachriz’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new547 bytes

This issue is also caused by the biblio_zotero module, which doesn't specify a "base" for the node type "zotero_feed". This is a required property, according to the documentation of hook_node_info():

base: (required) The base name for implementations of node-type-specific hooks that respond to this node type. Base is usually the name of the module or 'node_content', but not always.

However, it isn't required for the node specific form to define a title field. If the default base "node_content" is used and "has_title" is set to FALSE, there isn't a title field either. So Feeds should check that $node->title is set. Patch attached.

megachriz’s picture

Now with a test, which was quite easy to write. The tests only patch should fail.

The last submitted patch, 4: feeds-check-node-title-exists-2719151-4-tests-only.patch, failed testing.

twistor’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/tests/feeds_content_type.test
@@ -79,4 +79,29 @@ class FeedsContentTypeTest extends FeedsWebTestCase {
+    $this->assertEqual('', $node->title, 'The feed node has no title.');
+  }
 }

Missing newline can be fixed on commit.

  • MegaChriz committed 6b5a7ea on 7.x-2.x
    Issue #2719151 by MegaChriz: Fixed don't retrieve title from feed if...
megachriz’s picture

Status: Reviewed & tested by the community » Fixed

Committed #4 with one additional code comment in the tests.

Status: Fixed » Closed (fixed)

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