Send FAQ To Friend generates improper URL
Describe the bug When using Send FAQ to Friend feature -- the URL generated in the email is incorrect and invalid.
To Reproduce Use Send FAQ to Friend feature Input valid email address for recipient Check email for sent FAQ -- see incorrect generated URL for FAQ (https://F.Q.D.N/index.php?action=faq&cat=0&id=0&artlang=en is being generated in the body of the email)
Expected behavior Expect proper and functioning URL to be generated.
Screenshots
phpMyFAQ (please complete the following information):
- phpMyFAQ version -- 3.2.9
- PHP version -- 8.1.2-1ubuntu2.18
- Database - 8.0.39-0ubuntu0.24.04.2
- Elasticsearch NO
Desktop (please complete the following information):
Windows 11 Pro Version 23H2 Build 22631.4169 Microsoft Edge 129.0.2792.52 Google Chrome 129.0.6668.59
Additional context mod_rewrite is enabled and functioning -- tested with it both on and off and the URL is still generated incorrectly. redownloaded the latest .htaccess provided on github for 3.2.9 as a test as well to ensure proper .htaccess verified the apache configuration is allowing AllowOverride on the physical file path for phpmyfaq (/var/www/ask.mayesh in this case)
Hi @cmoore-mayesh, thanks for the issue. Sadly, I cannot reproduce this issue on my test installation. Did you tried it with an authenticated user or a guest user?
Hi @cmoore-mayesh, thanks for the issue. Sadly, I cannot reproduce this issue on my test installation. Did you tried it with an authenticated user or a guest user?
Both authenticated and guest users return the same malformed URL.
@cmoore-mayesh thanks for the fast response, I'll check what could have happened here.
Do you see the correct URL in the form before sending the mails?
Correct URL is in the form.
... and when you click on the button, the email has zeros instead of the correct IDs?
Confirmed -- email goes out, but the URL is getting mangled/lost somewhere between the form being submitted and the email sent. Screenshot attached.
Do you know about devtools in a browser?
Somewhat -- what is it you seek?
What do you see for the hidden form values?
Seems to be missing the hidden values for faqId and categoryId on my side.
The mentioned hidden form values are missing from both an authenticated user and a guest user.
Could you please check if your template is correct and it looks like the original one:
https://github.com/thorsten/phpMyFAQ/blob/3.2/phpmyfaq/assets/themes/default/templates/send2friend.html
....aaaaand there's the problem. A co-worker generated a new theme and the theme files were missing the vital lines for faqId and categoryId -- I copied them from your original template files into our new theme the problem is resolved.
We greatly appreciate your assistance in this resolution!
ah, great :-)