Display referer with "page not found" warnings

Thox - May 26, 2005 - 11:05
Project:Drupal
Component:watchdog.module
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

#1

ahoeben - July 26, 2005 - 07:52
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

ahoeben - July 26, 2005 - 09:20

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

ahoeben - July 27, 2005 - 21:06
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)

AttachmentSize
watchdog-referrer.patch 1.6 KB

#4

drumm - July 27, 2005 - 21:23

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

#5

kbahey - July 28, 2005 - 07:25

+1 on functionality too.

#6

Bèr Kessels - July 28, 2005 - 08:23
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

Stefan Nagtegaal - July 28, 2005 - 08:45

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.

AttachmentSize
watchdog-referer.patch 3.14 KB

#8

Stefan Nagtegaal - July 28, 2005 - 08:46
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

ahoeben - July 28, 2005 - 09:09

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

AttachmentSize
watchdog-referrer-cvs.patch 3.14 KB

#10

Gábor Hojtsy - July 28, 2005 - 09:20

+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

Stefan Nagtegaal - July 28, 2005 - 09:21

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

Junyor - July 28, 2005 - 09:26

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

#13

Stefan Nagtegaal - July 28, 2005 - 09:29

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

Ready to be applied... :-)

AttachmentSize
watchdog-referer-storage-final.patch 3.07 KB

#14

ahoeben - July 28, 2005 - 19:19

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

Junyor - July 28, 2005 - 19:57

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

Stefan Nagtegaal - July 28, 2005 - 21:30

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

#17

Steven - July 29, 2005 - 04:12
Status:needs review» fixed

Committed to HEAD.

#18

Anonymous - August 12, 2005 - 04:58

#19

Anonymous - August 26, 2005 - 05:00

#20

Anonymous - September 9, 2005 - 05:26

#21

Anonymous - September 23, 2005 - 06:31

#22

Anonymous - October 7, 2005 - 06:40
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.