Hi;

I used Flexifilter to create a new format that mimics Mediawiki formatting for links (by using the double brackets [[ ]] method).

With Wiki Tools, if someone clicks on such a link and receive a 404, they're given an option to create the page themselves.

When I installed the Link Checker Module (hoping to be able to develop a block view of "Wanted Pages" for pages that have not yet been created but are linked to), it doesn't seem to be catching these links? I edited a page adding in a new link using [[ ]], clicked on the link and reached the Wiki404 page (which includes a form to create the page since it does not exist). I ran cron and waited, but this link was never reported as broken.

I went into the database and it is listed in the linkchecker_links table - so it was extracted and read - it just didn't get recognized as being "broken". How can I work around this?

CommentFileSizeAuthor
#5 1045432-5.patch602 bytesjpmckinney

Comments

hass’s picture

Status: Active » Fixed

Can you share the link from linkchecker table? What value have the status "code" column? 200? If I have the link I can do a verbose check with wget see... but I guess it is 200 and this means OK. In this case the software that catches the Wiki404 page does not set the correct HTTP status headers.

This may be seen as a feature of a wiki software or a bug... I'd say - it's a BUG and it often occur if developers do not have an idea or have missed how the web servers/internet is working. Many can only write HTML, but have no clue of the stuff below (network level). And linkchecker rely on the network stuff... that need to be correct - always - doesn't matter what is shown in the browser. Developers can send a 404, but show a pretty Wiki404 page to enter some Text.

You can tell them they need to add the following line to their Wiki404 page and they are done:

D7:

drupal_add_http_header("Status", "404 Not Found");

D6:

drupal_set_header('HTTP/1.1 404 Not Found');
Fanaile’s picture

Project: Link checker » Wikitools
Version: 6.x-2.4 » 6.x-1.2
Component: User interface » Code
Category: support » bug

Hi :)

Yes, when I check the table, here is the output:

lid: 2
urlhash: cf11c35414c55b6dcec78d78b3f7b7aa
url: http://localhost/drupal/wiki/Nulla 
method: HEAD 
code: 200   
error:                  
fail count: 0    
last checked: 1296408778   
status: 1 

Taking your advice... I deleted the entry from the table, added the line drupal_set_header('HTTP/1.1 404 Not Found'); beneath the function theme_wikitools_page_does_not_exist line (about line 140 of the wikitools.pages.inc file) and cleared my theme registry, then re-analyzed links via link checker and ran cron and voila! It worked perfectly. I'll move this to their project page so that they can see everything.

Thank you!

hass’s picture

Status: Fixed » Active

Correct status :-)

hass’s picture

Title: Showing link as valid with custom search 404 for wiki » Missing wiki page does not set http status code 404

Topic sounds confusing to me, too.

jpmckinney’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Status: Active » Reviewed & tested by the community
StatusFileSize
new602 bytes

Putting Fanaile's comment into a patch. It works. RTBC.

jpmckinney’s picture

Status: Reviewed & tested by the community » Fixed

Fixed:

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.