Issue/Bug with User Save (Registration) with CF7

Activation link fails in ChronoForms 7 user registration.

Overview

The activation token generated by the User Save function contains dashes, which breaks the activation link.
Modify the specific PHP file to remove dashes from the generated token, ensuring the link functions correctly.

Answered
ChronoForms v7
go gotpowr 23 Sep, 2024
Answer
1 Likes

I found an issue with Chronoforms 7.

In using the User Save function, the activation token was being created with "-" (dashes) which was causing the activation link to not work. 

I tried a number of things and found that the token / activation field would not work if there were any dashes in it, but would work fine if you removed them from both the field and the link.

I did some digging (ok maybe a few hours worth lol) and found the following.  In the file:

...../administrator/components/com_chronoforms7/chronoforms/functions/joomla_user/joomla_user_output.php

In the $UserData section, this line was causing the problem:

'activation' => ((int)($status >= 2)) ? \G3\L\Str::uuid() : '',

I dove into the code in CF8 and was able to deduce what changes were needed to fix (CF8 seemed to not have the issue).  I replaced the line above in the php file in CF7 with:

'activation' => ((int)($status >= 2)) ? str_replace("-", "", \G3\L\Str::uuid()) : '',

Hopefully this helps anyone who runs into the issue, or helps with patching it in a future release 😃

Max_admin Max_admin 17 Oct, 2024

thank you very much for posting this fix! 😊

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.