I've been annoyed (for a while) that when you look at the Track tab on a node (say: node/10/track) if there are no referrers the page would display a long list of node/10/track as referrers.

I've tracked it down to function statistics_node_tracker() & the use of _statistics_link(). If we check to see if the $log->url is empty as I've done here:

    foreach ($result as $log) {
      $rows[] = array(
        array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')),
        (!empty($log->url)) ? _statistics_link($log->url) : '',
        theme('username', array('account' => $log)),
        l(t('details'), "admin/reports/access/$log->aid"),
      );
    }

The problem goes away and you just get a list of valid Referrer URLs.

I can do up a patch against D8 but wanted to run this by folks first. Seems like a simple fix.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

darrell_ulm’s picture

Version: 7.x-dev » 8.x-dev
Status: Active » Closed (fixed)

This appears fixed. Behavior no longer occurs. Or at least so it seems in 7 or 8.

mgifford’s picture

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

Ok, but it still hasn't worked it's way into D7. I'm also not sure if it was fixed here or elsewhere. I don't see anything in the D8 code that adds a check to see if the result is empty or not.

I haven't confirmed if it works in D8 yet or not. This should probably also be marked as a duplicate of another issue.

darrell_ulm’s picture

Version: 8.x-dev » 7.x-dev
Status: Closed (fixed) » Active

Yeah, the code is the same in both and the ?: conditional or equivalent has not been added.

The query is the same also in both and still can't seem to reproduce.

The database doesn't have the list of repeated entries due to another code change or some other reason.

mgifford’s picture

Status: Active » Postponed

Ok, I'll come back to this then when I can give you something I can replicate. Thanks.

tim.plunkett’s picture

Issue tags: +Needs backport to D7

Fixing tag.

EdgarPE’s picture

Status: Postponed » Needs review
FileSize
573 bytes

Wrong patch, sorry.

EdgarPE’s picture

This is a the correct patch.

mgifford’s picture

vanessakovalsky’s picture

Issue summary: View changes
Issue tags: +Needs tests