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.
Comment | File | Size | Author |
---|---|---|---|
#7 | statistics-empty-referer-v2.patch | 572 bytes | EdgarPE |
#6 | statistics-empty-referer.patch | 573 bytes | EdgarPE |
Comments
Comment #1
darrell_ulm CreditAttribution: darrell_ulm commentedThis appears fixed. Behavior no longer occurs. Or at least so it seems in 7 or 8.
Comment #2
mgiffordOk, 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.
Comment #3
darrell_ulm CreditAttribution: darrell_ulm commentedYeah, 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.
Comment #4
mgiffordOk, I'll come back to this then when I can give you something I can replicate. Thanks.
Comment #5
tim.plunkettFixing tag.
Comment #6
EdgarPE CreditAttribution: EdgarPE commentedWrong patch, sorry.
Comment #7
EdgarPE CreditAttribution: EdgarPE commentedThis is a the correct patch.
Comment #8
mgifford7: statistics-empty-referer-v2.patch queued for re-testing.
Comment #9
vanessakovalsky CreditAttribution: vanessakovalsky as a volunteer commented