Empty ResetPasswordUrl macro value

Joe Tannouri asked on May 16, 2017 09:46

Hello,

I am using v8.1.15 for one of my projects and it turned out that the change password request email does not contain the reset url (ResetPasswordUrl macro value is empty) while the cancel url is working as expected (CancelUrl macro has a value). After searching in devnet I've found a hotfix (8.2.1) that addresses a bug related to the issue I am facing (The reset password URL in the email that users receive after submitting a password reset request on the logon form wasn't resolved correctly in certain cases.)

Is there a way to fix this issue without applying the hotfixes? Since I have done a lot of modifications and custom codes to the application and applying the hotfixes requires me to upgrade to v8.2 and apply the cumulative hotfixes.

Any help would be appreciated.

Thanks, J.

Correct Answer

Joe Tannouri answered on June 2, 2017 14:47

Instead of doing all that extra coding, and since that the CancelUrl value is available, I used this syntax to get the ResetPasswordUrl from CancelUrl:

{%CancelUrl.Split("&")[0]+"&"+CancelUrl.Split("&")[1]+"&"+CancelUrl.Split("&")[2]#%}
1 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on May 16, 2017 13:21

Without finding the specific issue and attempting to just apply that code specifically, I don't believe there is a simple fix. You could contact Kentico support and find out if they have a simple hotfix application for it. A better method is to not code yourself/client into a corner with non-best practice customizations so you at least have an upgrade path in the future.

Upgrading to v8.2 is not a hard step BUT check out the release notes to see what kind of impact it might have on your project before upgrading.

For your actual problem, you could hard code the static part of the url URL and create your own macro to get the hash value that is created for that user to finish the URL off.

2 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on May 16, 2017 16:34 (last edited on May 16, 2017 16:53)

If you go to System > Settings > Security & Membership > Password reset There is field called reset password url. Check the value for your site and globally. (Just make sure that you don't have any space there or something) if the value is not set, system page ~/CMSModules/Membership/CMSPages/ResetPassword.aspx will be used. Also check in the DB: select * from CMS_SettingsKey where KeyName = 'CMSResetPasswordURL' In my case keyvalue field is '/signin/reset-password/' (the default).

And if you don't want to do an upgrade - why not create your own macro for this case?

1 votesVote for this answer Mark as a Correct answer

Joe Tannouri answered on May 17, 2017 08:45

Hi Brenden, thank you for your answer. Upgrading to v8.2 is not hard but it requires revisiting the custom code and testing the whole system, what I was hoping for is a quick fix for the bug, I'll try reaching out to support to check if they might have a simple hotfix application for it. At the mean time I will try creating the custom macro.

1 votesVote for this answer Mark as a Correct answer

Joe Tannouri answered on May 17, 2017 08:49

Hi Peter, thank you for your answer. I have already checked the values in the settings section and also tried changing them but it did not work. I think the custom macro at the mean time would help fix it.

1 votesVote for this answer Mark as a Correct answer

Joe Tannouri answered on May 17, 2017 14:17

How to get the user's email while creating the macro?

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.