I cannot seem to get your patches to work. I'm using 4.7.4, and there doesn't seem to be a patch for 4.7.4 included, so I used the patch for 4.7.3. However, patch keeps throwing an error message whenever I try to use the patch from drupal root:

patching file includes/common.inc
Hunk #1 succeeded at 324 (offset 3 lines).
patch: **** Can't reopen file /tmp/poEIF1Bo : Permission denied

Afterwards, the file common.inc is missing. However, there seems to be a file called common.inc.orig, which I am guessing is the original, unpatched common.inc.

The string after /tmp in the error message seems to be random, too.

Comments

kbahey’s picture

Status: Active » Closed (fixed)

This is not a problem with the patch. It is a problem with your setup: the patch command does not have the necessary permissions.

Any way, the patch is easy:

Find this:

function drupal_access_denied() {
  drupal_set_header('HTTP/1.0 403 Forbidden');
  watchdog('access denied', t('%page denied access.', array('%page' => theme('placeholder', $_GET['q']))), WATCHDOG_WARNING, l(t('view'), $_GET['q']));

Add this line after that:

$_SESSION['destination'] = $_GET['q'];

That is all.