Ticket #40 (Fixed)Sun Aug 06 22:54:59 UTC 2006
Typo gives wrong URL in e-mail notifications
Reported by: | Andrew | Severity: | Minor |
Part: | Web site: Typo (blog engine; news pages) | Release: | |
Milestone: | Status | Fixed |
Details by Andrew:
When a new article is created, Typo gives the wrong URL to the administrative interface – “This is being sent to <user> because you asked to be notified via email whenever new content is posted to <admin address>”. The address ends in ‘articles’ but should end in ‘content’.
Changelog:
Modified by Andrew Mon, August 07 2006 - 13:42:07 GMT
- Status changed from Open to Fixed
Fixed in Changeset #67.
Modified by Andrew Mon, August 07 2006 - 23:23:46 GMT
- Status changed from Fixed to Open
Re-opened for Typo 4.0.0. The mailer partial seems to insist on putting “/admin” into all URLs even when it is already there, producing things like “/admin/admin”, for new post alerts.
Modified by Andrew Tue, August 08 2006 - 15:41:31 GMT
The mail footer is common. When using the public interface to comment on posts, the URLs are correct. The controller in use at that point is not from the ‘admin’ subdirectory. When posting articles the controller in use is from the ‘admin’ subdirectory and the e-mail messages contain invalid URLs because “admin/” appears in the link when it shouldn’t.
- ActionView::Helpers::UrlHelper module’s link_to() method calls url_for() if given URL parameters rather than a String.
- Module’s url_for() method calls to the controller’s url_for() method.
- No Typo controllers overload this method.
- Admin controllers inherit from a base controller. The base controller inherits from the application controller, which inherits from ActionController::Base as usual.
- Therefore ActionController::Base ought to be the entity that is inserting “admin/” into URLs.
Investigation ongoing.
Modified by Andrew Tue, August 08 2006 - 21:00:58 GMT
- Status changed from Open to Fixed
Overriding url_for defaults by putting a “/” in front of the controller name in the mail footer partial does seem to fix the problem, though I have a nagging feeling that the fix really ought to happen down in the routes somewhere.
See Changeset #78.
Modified by Andrew Tue, August 08 2006 - 21:18:29 GMT
Change suggested as a possible bug fix with query on the routes issue in Typo Ticket #1078
Modified by Andrew Tue, August 08 2006 - 21:19:07 GMT
Hmm, Collaboa’s rather aggressive “ticket number” auto-linker getting in the way there! The Typo ticket can be found here.