Allow embedding setting messes up notification emails
I noticed a small bug in the email notifications. The email said:
A new reply for you to review, here, on page "Comments for http://book.local:1317/chapters/rules-for-software-tutorials/". It's been preliminarily approved, and is visible to others.
I was confused at first because book.local is a host on my home network.
The comment was actually on my website's public URL:
https://refactoringenglish.com/chapters/rules-for-software-tutorials/
I remembered that I had added book.local:1317 to /-/admin/settings/embedded-comments
during development, and it was the last URL in the list.
I suspect that's where TalkYard was getting the URL because I can't think of anywhere else where it would pick up that hostname.
Note: I've changed my actual internal hostname here for privacy.
- In reply tomichael⬆:KajMagnus @KajMagnus2025-01-04 18:52:58.751Z
I think you're right, seems I can reproduce. I'll write more tomorrow ... (Thanks for the bug report :- ))
- In reply tomichael⬆:KajMagnus @KajMagnus2025-01-05 06:48:50.711Z
Hi again, so, Talkyard has remembered (in the database) the first URL where the page was shown (
book.local:1317/...
), and when later the same page appears at another URL (refactoringenglish.com/...
), Talkyard still thinks (incorrectly) the first URL is the right one.This can be fixed by editing the URL via the admin UI, as follows: (let me know if you'd like me to log in as superadmin and do this?)
- As admin, go to Settings | Features:
/-/admin/settings/features
. - Enable Experimental features (at the bottom), click Save.
- A new tab appears at the top: Content. Switch to it.
- Scroll down to the blog post comments page (you can search for "book.local ...." to find it).
- Click Edit
- Type the correct URL in the Link-To URL field (which, hmm, is named differently: "Canonical embedding URL" in the list outside the dialog).
- Click Save. Now the dialog just "hangs" — I haven't finished implementing this. But reload the page, and you'll see that the URL has been updated.
Thereafter, new comment notifications should use the correct URL. I can post another test comment just to verify that it works, if you ping me here?
***
(It would be better if 1) Ty used [the URL the comment author was at when submitting the comment], or if 2) Ty realized that it should update the URL in the database, when the allow-embedding-from URL is edited. I'll need to have a look and see what's best ... But anyway, in your case, for blog posts created in the future, Ty will remember the correct URL, since no one visits them via
book.local...
any more.)- Michael Lynch @michael
Thanks for the suggested workaround!
Unfortunately, I was not successful. I tried changing the "Link-To URL" to:
https://refactoringenglish.com/chapters/rules-for-software-tutorials/
I hit "Save" and the dialog does appear to save correctly. But then if I reload
/-/admin/contents
, the changes seem to revert. The internal book.local:1317 URL is back.Also, when I edit the blog comments page, book.local also appears in "Page URL path" (which I can't edit) and "Embedding URLs, one per line" which I can change but I'm not sure if I should.
- KajMagnus @KajMagnus2025-01-05 13:22:49.540Z
Hi, now it works — I refreshed the in-memory cache, so now it's picked up the changes from the database, if that was needed.
Now the URL is the right one, look: (I posted another test comment, and copied this from a database table with outgoing emails)
A new reply for you to review, <a href="https://refactoringenglish.com/chapters/rules-for-software-tutorials/#comment-5">here</a>, on page "<i>Comments for http://[redacted].local:1317/chapters/rules-for-software-tutorials/</i>". + It's been preliminarily approved, and is visible to others. It was posted by <i>kajmagnus_tyio</i>, on 2025-01-05: + </p><hr/><p style="padding-left: 2em">Another test comment</p><hr/><div></div> [...]
But the page title is still the wrong one, i.e. Comments for http://[redacted].local:1317.
If you go here, though, you can edit the title to something more nice: https://comments-for-refactoringenglish.talkyard.net/-4 (page id 4)Talkyard picked the first URL it saw, namely the
book.local...
URL, and used as part of both the page slug and page title.also appears in "Page URL path" (which I can't edit)
Hmm yes it seems it's not possible to edit the URL path for embedded comments pages. They're not used anywhere though, since one normally doesn't visit the Talkyard page directly, only the embedding blog post.
"Embedding URLs, one per line" which I can change but I'm not sure if I should.
You can leave those as is, doesn't matter. It's for rare situations when migrating between software and/or domains, or if embedding the same discussion on two different URLs.
- KajMagnus @KajMagnus2025-01-05 14:22:13.535Z
(An idea, @michael: if you edit the title of the "Comments for http://[redacted].local:1317" page, and then reply to my test comment, I can forward the notification email I should be getting, to you, so you can see how it looks. And then delete the test comments)
- Michael Lynch @michael
Oh, I had already deleted it before I saw this. Is it possible to undelete a comment? If I click "Do nothing (already deleted)" it says I deleted it, but I don't see a way of undeleting.
- As admin, go to Settings | Features:
- Progresswith handling this problem