I have installed the module and not changed any of the settings. When trying to access a page without permission i get this error:
Fatal error: Call to undefined function drupal_urlencode() in /home/cvmateco/public_html/sites/all/modules/r4032login/r4032login.module on line 92

CommentFileSizeAuthor
#5 r4032login.zip1.72 KBmarty2081
#4 r4032login.zip1.69 KBmarty2081

Comments

heyehren’s picture

I found a better way to redirect users in my particular case.

The easiest way to redirect to the login/ register page is by defining the path to a custom page in the Drupal settings.

Go to Configuration --> Site information and scroll down to the bottom :)

BenK’s picture

Subscribing

tinker’s picture

drupal_urlencode($path) is only used in Drupal 4.7 -> 6. The function has been renamed to drupal_encode_path($path) in D7.

marty2081’s picture

StatusFileSize
new1.69 KB

It's not only the drupal_urlencode($path) that has to be fixed. Also the usage of url() in the header() function is incorrect which results in an error.

I've attached a version of r4032login.module where I've made changes to make it work again, although I'm not sure if the code is very good, it works for me. I've also replaced the use of $_REQUEST by using request_uri().

I'm sorry I don't have the possibility to create a patch file right now.

[EDIT:] Further testing it I found some more problems, so forget this version!

marty2081’s picture

StatusFileSize
new1.72 KB

The problem I had was that the destination parameter always had a starting '/' that resulted in '//' in the URL, so I added an if-statement to remove that '/' from the uri if it is the first character. Again: I don't know if the code is correct, but for the moment it works. The thing that still doesn't work is that I don't see the message that the user doesn't have the authorization to access a certain page and that he has to login...

coltrane’s picture

The r4032login_redirect() function in 7.x-1.x-dev has some rewrites and is not at fault for this error.

BarisW’s picture

Tried the 7.x-1.x-dev, but the error still occurs.

lotyrin’s picture

Status: Active » Closed (fixed)

We no longer call drupal_urlencode().

BarisW’s picture

@lotyrin: thanks for the update. But please don't close issues by setting them to 'closed' directly. Set them to fixed, and they will be set to 'closed' automatically after two weeks. During these two weeks the issue appears in the users Dashboard so others can keep better track of updates. 'closed' issues don't show up there.