# Summary

Redirect the HTTP 403 error page to the Drupal /user/login page with an optional message that reads:

"Access denied! You must login to view this page."

Also, the desired page is appended in the url query string so that, once login is successful, the user is taken directly where they were originally trying to go.

# Project URL

https://www.drupal.org/project/r4032login

# Where is the code?

https://www.drupal.org/project/r4032login

# Estimated completion date

Unknown

# Dependencies

N/A

# Who's doing the port?

https://www.drupal.org/u/bdone

# What help do they need?

Unknown

# D8 roadmap

https://www.drupal.org/node/2189179

# Background and reference information

https://www.drupal.org/node/2189179

Comments

Patrick Storey created an issue. See original summary.

bdone’s picture

Issue summary: View changes
Status: Active » Needs work

Needs work = D8 development has started but is not yet usable.

per contrib_tracker, needs work seems like an appropriate status.

bdone’s picture

Assigned: Unassigned » bdone
jaapjan’s picture

What is the current status of the port?

We've been successfully using this module in Drupal 8 for quite a while now in the Open Social distribution. Perhaps it's an idea to tag an alpha release?

jaapjan’s picture

Any update on this? Perhaps you could tag an alpha release?

esmith818’s picture

Hey @bdone, what's the latest on this module? I see that @jaapjan suggests he is using it in a D8 distro, but I am getting errors in a D8 sandbox when testing. We're (finally) looking into updating the Guardr distro and would like to include this module.

( ! ) Fatal error: require(): Failed opening required '/d8sandbox/sites/all/modules/contrib/r4032login/src/EventSubscriber/R4032LoginSubscriber.php' (include_path='.:') in /d8sandbox/vendor/symfony/class-loader/ApcClassLoader.php on line 112
Call Stack
#	Time	Memory	Function	Location
1	0.0007	367504	{main}( )	.../index.php:0
2	0.0017	479944	Drupal\Core\DrupalKernel->handle( )	.../index.php:19
3	0.0074	1401496	Stack\StackedHttpKernel->handle( )	.../DrupalKernel.php:664
4	0.0074	1401496	Drupal\Core\StackMiddleware\NegotiationMiddleware->handle( )	.../StackedHttpKernel.php:23
5	0.0074	1401496	Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle( )	.../NegotiationMiddleware.php:50
6	0.0074	1401496	Drupal\page_cache\StackMiddleware\PageCache->handle( )	.../ReverseProxyMiddleware.php:47
7	0.0077	1404176	Drupal\page_cache\StackMiddleware\PageCache->lookup( )	.../PageCache.php:75
8	0.0081	1404176	Drupal\page_cache\StackMiddleware\PageCache->fetch( )	.../PageCache.php:121
9	0.0081	1404176	Drupal\Core\StackMiddleware\KernelPreHandle->handle( )	.../PageCache.php:184
10	0.0112	1841656	Drupal\Core\StackMiddleware\Session->handle( )	.../KernelPreHandle.php:47
11	0.0122	1874984	Symfony\Component\HttpKernel\HttpKernel->handle( )	.../Session.php:57
12	0.0266	2874632	Symfony\Component\HttpKernel\HttpKernel->handleException( )	.../HttpKernel.php:79
13	0.0270	2880792	Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch( )	.../HttpKernel.php:228
14	0.0337	3113208	Drupal\Core\DependencyInjection\Container->get( )	.../ContainerAwareEventDispatcher.php:105
15	0.0337	3116992	Drupal\Core\DependencyInjection\Container->createService( )	.../Container.php:171
16	0.0345	3129832	spl_autoload_call ( )	.../Container.php:270
17	0.0345	3130008	Symfony\Component\ClassLoader\ApcClassLoader->loadClass( )	.../Container.php:270
bgm’s picture

I tested it on Drupal 8.5.1 and it worked fine.

estoyausente’s picture

I tested with 8.5.1 too and it seems works. I didn't test any extrange configuration, just the basic behavior but it seems correct!

I think that a beta version can be released!

flo81’s picture

Tested on a 8.5.3, it works fine out of the box ! Nice job thanks.

Nixou’s picture

The plan is to fix all remaining 8.x issues before to release a beta or stable version.

You can expect this release within 1 to 2 weeks.

Nixou’s picture

Status: Needs work » Needs review

The first beta release has been created.

Please review and create issues if you find a problem.

AdamPS’s picture

Great many thanks @Nixou on behalf of all of us who have been waiting for a release. I installed it and it works for me.

Nixou’s picture

You're welcome :).

I just created a beta2 release with the fix for https://www.drupal.org/project/r4032login/issues/2979210.

Nixou’s picture

Status: Needs review » Fixed

The beta2 release is currently used by 405 sites and there was not new issues since its publication.

So I created a stable version.

Status: Fixed » Closed (fixed)

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