Recent Content page displays list of recently-added content but the following appears top of page:

* Notice: Undefined property: stdClass::$comment_count in tracker_page() (line 53 of /export/data/www/htdocs/modules/tracker/tracker.pages.inc).
* Notice: Undefined property: stdClass::$type in tracker_page() (line 63 of /export/data/www/htdocs/modules/tracker/tracker.pages.inc).
* Notice: Undefined property: stdClass::$title in tracker_page() (line 64 of /export/data/www/htdocs/modules/tracker/tracker.pages.inc).
* Notice: Undefined property: stdClass::$last_activity in tracker_page() (line 67 of /export/data/www/htdocs/modules/tracker/tracker.pages.inc).
* Notice: Undefined property: stdClass::$type in tracker_page() (line 74 of /export/data/www/htdocs/modules/tracker/tracker.pages.inc).
* Notice: Undefined property: stdClass::$comment_count in tracker_page() (line 88 of /export/data/www/htdocs/modules/tracker/tracker.pages.inc).
* Notice: Undefined property: stdClass::$last_activity in tracker_page() (line 93 of /export/data/www/htdocs/modules/tracker/tracker.pages.inc).
* Notice: Undefined property: stdClass::$comment_count in tracker_page() (line 94 of /export/data/www/htdocs/modules/tracker/tracker.pages.inc).
* Notice: Undefined property: stdClass::$last_activity in tracker_page() (line 95 of /export/data/www/htdocs/modules/tracker/tracker.pages.inc).

CommentFileSizeAuthor
#3 Screenshot.png295 KBjuves
9-24-2010 2-02-21 PM.jpg285.45 KBbeddoe
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Eolmornedhel’s picture

I found the following got rid of the errors:

line 53: if (isset($node->comment_count)) {
line 63: 'type' => check_plain(node_type_get_name(isset($node->type))),

and repeat the addition of isset() for each remaining error.

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce this.

Can you give more details about your setup -- content types, comment settings, etc?

juves’s picture

FileSize
295 KB

Same problem.

Interesting, there is actually no node with id 15 (see screenshot)

juves’s picture

Version: 7.0-alpha7 » 7.0-rc1
joachim’s picture

IIRC Tracker on D7 caches its own data about nodes. Could it be it has data about node 15, but you since deleted node 15, and it's not caught up?

Can you look at tracker module's tables?

juves’s picture

Yes, I deleted them from both tables, there are no more notices

joachim’s picture

Ah... I rather wanted you to check what was in those tables!

juves’s picture

I can reproduce it by creating and deleting a new node.

node 16, user 15

tracker_node

nid published changed
16 1 1291314018

tracker_user

nid uid published changed
16 15 1 1291314018

its all still there, I flushed cache und ran cron after deleting.
it's independent from the content type.

joachim’s picture

Status: Postponed (maintainer needs more info) » Active

Confirming this.

I reproduced like this:

1. create a node. notice it's shown in the tracker
2. delete the node.
3. go to the tracker and see the error messages.

joachim’s picture

Title: Undefined property in tracker.pages.inc » tracker needs to act on node deletion -- undefined property in tracker.pages.inc

Adding description of the problem to the title.

joachim’s picture

Title: tracker needs to act on node deletion -- undefined property in tracker.pages.inc » error messages on tracker page - tracker_node_delete() does not correctly act on node deletion
Version: 7.0-rc1 » 7.x-dev
Priority: Normal » Major

The problem is here:

function _tracker_remove($nid, $uid = NULL, $changed = NULL) {
  $node = db_query('SELECT nid, status, uid, changed FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();

  // The user only keeps his or her subscription if both of the following are true:
  // (1) The node exists.
  // (2) The user is either the node author or has commented on the node.
  $keep_subscription = FALSE;

  if ($node) {

Tracker only cleans up its tables if there is no node. However, hook_node_delete() is invoked BEFORE core deletes the node, hence tracker's logic fails. See also #988030: Document correct sequence of hooks in node deletion.

moshe weitzman’s picture

Um, shouldn't tracker implement hook_node_delete like everyone else?

joachim’s picture

It does -- hook_node_delete calls the code above.

But I am guessing this was written before the change at #890790: deleting nodes does not delete their comments..

Tracker assumes hook_node_delete is invoked AFTER the node has been deleted. This is no longer the case, so tracker's query to see whether a node exists returns a positive, and then it erroneously decides to not delete its records.

FanisTsiros’s picture

Should this #950680: Multiple notices from tracker after deleting a node marked as duplicate ?
There 's also a patch there.

catch’s picture

Status: Active » Closed (duplicate)

Marking this as duplicate of #950680: Multiple notices from tracker after deleting a node, the other issue is RTBC.