Ticket #14429 (new defect)
Comment notify email has invalid links when siteid option is off
| Reported by: | alfromlongbeach@… | Owned by: | |
|---|---|---|---|
| Priority: | major | Component: | General |
| Version: | 5.4 | Keywords: | email comment link |
| Cc: | issues@… | Time planned: | 1d |
| Time remaining: | 1d | Time spent: | 1d |
Description
Emails that are generated to site contact, to notify of new comment posted, will provide links that still contain the siteid in the path, even when the target Mura system is set to hide siteid in URLs.
The resulting links produce 404 errors from the server/tomcat to the user when clicked.
Attachments
Change History
comment:3 Changed 9 months ago by alfromlongbeach@…
from a forum post by spleeze 2-2-11:
I just patched this in my local copy. The fix for me was in requirements/mura/content/contentCommentBean.cfc at line 439.
I changed the hardcoded URLs (with siteID and index) to be more dynamic based on the site configuration:
<cfset var serverpath = ' http://#listFirst(cgi.http_host,":")##variables.configBean.getServerPort()##variables.configBean.getContext()#/'>
<cfif application.configBean.getSiteIDInURLS()>
<cfset serverpath &= '#getSiteID()#/'>
</cfif>
<cfif application.configBean.getIndexFileInURLS()>
<cfset serverpath &= 'index.cfm/'>
</cfif>
<cfsavecontent variable="notifyText"><cfoutput> A comment has been posted to "#rscontent.title#" by #getName()#.
COMMENT: #getComments()#
Approve #serverpath##variables.utility.createRedirectID(arguments.contentRenderer.getCurrentURL(true,"approvedcommentID=#getCommentID()#"))#
Delete #serverpath##variables.utility.createRedirectID(arguments.contentRenderer.getCurrentURL(true,"deletecommentID=#getCommentID()#"))#
View #serverpath##variables.utility.createRedirectID(arguments.contentRenderer.getCurrentURL())# </cfoutput></cfsavecontent>

Links on site manager dash might exhibit same problem. Want a separate ticket?