Notifications about page changes have wrong link #237
Labels
No labels
Component: User interface
Component: Wymeditor
Help wanted
Level: Difficult
Level: Easy
Level: Moderate
Pagetype: Festival
Pagetype: Mailinglist
Pagetype: Peer reviewed article
Pagetype: Text
Privacy GDPR AVG
status: has conflicts
Status: Needs changes
Status: Needs discussion
Status: Needs review
Status: Ready to merge
Status: Waiting for response
Type: Bug
Type: Enhancement
Type: Question
Usecase: De Stadsbron
Usecase: Koppelting
Usecase: MeetjeStad
Value: Coders
Value: Security
Value: Users
Value: Visitors
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
harmen/hypha#237
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Whenever people change a page, certain users receive mails with notifications about which page was changed and a link to see the changes.
The link to the page is OK, but the link to the changes only shows the front page of the hypha instance.
I've had a look a tthis, the problem is that
addBaseUrlis a bit overzealous. These links are supposed to behref="#5b0d573837e4d" and refer to anchors inside the e-mail, butaddBaseUrl` instead lets them refer to the online page.This is a bit of a challenge, since
addBaseUrlcannot really distinguish between links that are intended to self-reference the e-mail and links that are intended to refer to pages online. We could special-case anchor-only links (e.g. starting with #), but that does not feel so nice. A more elegant approach would be to explicitly opt-out these links by adding aclass="no-base-url"or something like that.Currently,
addBaseUrlstill uses regex-based replacement. For the above exception to be reliably implemented, this should be switched to an xpath-based implementation (#190). It would probably be good to change the mail-sending code (which now does dewikify_html and then addBaseUrl to convert the html string to a DomDocument node once, and then pass it to dewikify and (the rewritten) addBaseUrl, so the string -> node conversion only happens once. It might even be useful to change thesendMailfunction to build up a complete DomDocument for the message body, rather than the string concatenation it does now. This would make it even easier to convert the string message to a node.