Download & Extend

Display referer with "page not found" warnings

Project:Drupal core
Component:watchdog.module
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I get plenty of "page not found" warnings when I look at the admin page, but I have no way to fix them. The pages (rightfully) no longer exist, so I'd simply like to stop links pointing there. If the referering page was part of the message, that would be far more helpful.

Comments

#1

Version:4.6.0» 4.6.2
Component:base system» watchdog.module

Referer / referrer loggin would be usefull for a more than just page not found warnings. I'ld say include them where available.

#2

This requires minor changes in bootstrap.inc (watchdog() function), the watchdog module, as well as an alteration to the watchdog table. I'll try to make a patch

#3

Category:feature request» task
Status:active» needs review

Here's the patch against 4.6.2.

First, you need to execute this SQL statement to alter the watchdog table:
ALTER TABLE `watchdog` ADD COLUMN `referer` varchar (128)  NOT NULL

Next, the patch includes two one-line changes, one each for includes/bootstrap.inc and modules/watchdog.module
(you may have to split up the patch file and run them one by one or manually)

AttachmentSizeStatusTest resultOperations
watchdog-referrer.patch1.6 KBIgnored: Check issue status.NoneNone

#4

+1 for this functionality, but it needs to be a patch against Drupal CVS.

#5

+1 on functionality too.

#6

Status:needs review» active

+1 on the idea.
But this really needs a patch for update.php and database.* marking this "active" untill that is in place.

#7

Okay I updated the patch to apply against HEAD.
I also updated the update.inc to reflect the changes..

Please update the patch or apply.. I do not have time to keep this patch up-to-date.

AttachmentSizeStatusTest resultOperations
watchdog-referer.patch3.14 KBIgnored: Check issue status.NoneNone

#8

Version:4.6.2» <none>
Status:active» needs review

Status -> 'Patch', Version -> 'CVS'..
I updated the patch to work with current HEAD.

Please apply or pdate yourself. I do not have time to keep this patch up-to-date.. Sorry

#9

New patch against CVS. Includes stefan's patch for updates.inc (thanks) and adds database.mysql and database.pgsql

AttachmentSizeStatusTest resultOperations
watchdog-referrer-cvs.patch3.14 KBIgnored: Check issue status.NoneNone

#10

+1, I was just looking for this data on 404 messages, and found nothing useable on my 4.6 site, obviously searching for referer data.

#11

I noticed this while making the patch myself, but we use 'referer' in the code and database layer, but in the table header we use 'referrer'.. Notice the 'r' against 'rr'..
I'm not a native English speaking person, but I would like to see some consistency between this.. Or 'referrer' or 'referer', not both please...

For the patch it's functionality +1!

#12

Stefan: The header is actually called 'referer', so in the code it makes sense.

#13

Okay, updated patch to use 'referer' instead of 'referrer'...

Ready to be applied... :-)

AttachmentSizeStatusTest resultOperations
watchdog-referer-storage-final.patch3.07 KBIgnored: Check issue status.NoneNone

#14

Actually, the HTTP header calls it 'referer', but 'referrer' is better english (AFAIK, but I am not a native english speaker either). That's why I used referer internally (since it's a reference to the HTTP header), but referrer in the presentation (better english).

You Say Potato, I Say Potato

#15

Right. I didn't mean to imply that anything needed to change. In the code it makes sense to use 'referer' while the text would make sense as either 'referer' or 'referrer'. Sorry for your trouble, Stefan.

#16

Well, patch #10 use 'Referrer' and #13 uses 'Referer'.. Let the Drupal Gods dicide which one to apply to core... :-)

#17

Status:needs review» fixed

Committed to HEAD.

#18

#19

#20

#21

#22

Status:fixed» closed (fixed)