phpMyFAQ icon indicating copy to clipboard operation
phpMyFAQ copied to clipboard

Send FAQ To Friend generates improper URL

Open cmoore-mayesh opened this issue 2 years ago • 15 comments

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 2024-09-25 14_21_26-Outlook (PWA)

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)

cmoore-mayesh avatar Sep 25 '24 18:09 cmoore-mayesh

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?

thorsten avatar Sep 26 '24 16:09 thorsten

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 avatar Sep 26 '24 16:09 cmoore-mayesh

@cmoore-mayesh thanks for the fast response, I'll check what could have happened here.

thorsten avatar Sep 26 '24 16:09 thorsten

Do you see the correct URL in the form before sending the mails? Bildschirmfoto 2024-09-26 um 19 11 17

thorsten avatar Sep 26 '24 17:09 thorsten

Correct URL is in the form. image

cmoore-mayesh avatar Sep 26 '24 17:09 cmoore-mayesh

... and when you click on the button, the email has zeros instead of the correct IDs?

thorsten avatar Sep 26 '24 17:09 thorsten

Confirmed -- email goes out, but the URL is getting mangled/lost somewhere between the form being submitted and the email sent. Screenshot attached. image

cmoore-mayesh avatar Sep 26 '24 17:09 cmoore-mayesh

Do you know about devtools in a browser?

thorsten avatar Sep 26 '24 17:09 thorsten

Somewhat -- what is it you seek?

cmoore-mayesh avatar Sep 26 '24 17:09 cmoore-mayesh

What do you see for the hidden form values? Bildschirmfoto 2024-09-26 um 19 22 02

thorsten avatar Sep 26 '24 17:09 thorsten

Seems to be missing the hidden values for faqId and categoryId on my side.

image

cmoore-mayesh avatar Sep 26 '24 17:09 cmoore-mayesh

The mentioned hidden form values are missing from both an authenticated user and a guest user.

cmoore-mayesh avatar Sep 26 '24 17:09 cmoore-mayesh

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

thorsten avatar Sep 26 '24 17:09 thorsten

....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.

image

We greatly appreciate your assistance in this resolution!

cmoore-mayesh avatar Sep 26 '24 17:09 cmoore-mayesh

ah, great :-)

thorsten avatar Sep 26 '24 17:09 thorsten