Drupal
Drupal: AdSense Module - Getting access denied instead of page not found
If you noticed something weird at howforge.com, 404 file not found was missing. Instead, it was replaced by 403 access denied. The cause of this problem is exactly adsense.module. Let me show you something.
function adsense_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
’path’ => ’’,
’callback’ => ’’,
’title’ => ’’,
’access’ => user_access(’hide adsense’),
’type’ => MENU_CALLBACK,
’weight’ => 0);
}
return $items;
}
This menu hooking is totally incorrect. The empty path makes all page not found errors replaced by access denied errors. To fix this problem, I simply commented this function out. The patch is as below and also submitted at drupal.org.
- sugree's blog
- Add new comment
- Read more
- 1643 reads
Recent comments
3 years 29 weeks ago
3 years 34 weeks ago
3 years 35 weeks ago
3 years 35 weeks ago
3 years 35 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago