Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Overriding URL for a revision creates an invalid url for a revision=>404 #59

Closed
msevestre opened this Issue · 11 comments

3 participants

@msevestre
Collaborator

Step to reproduce
1 - Create a new blog entry
2 - Set the URL to "blah"
3 - Save the post

Going to the home page (not in the admin section), the newly created blog is visible and the url points to /blah
However clicking on the url returns a 404

The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.

@jipiboily
Owner

What is the mount point of your app? I suspect it is not root maybe?

@msevestre
Collaborator

yes indeed.
mount Monologue::Engine, :at => "/monologue"

This is using the default mount point in the dummy application
I'll try to write a test to reproduce that error

@jipiboily
Owner

It is not a bug in Monologue in fact. If it is mounted in "/monologue", it can't handle any route of the main_app, only it's own routes in "/monologue/whatever".

Any suggestion? Maybe a validation to make sure url is starting with mount point?

@msevestre
Collaborator

Well I believe this is more a 'Monologue' bug than a 'user' bug. A non tech-savvy user might have some trouble understanding why this behaves like that.

My suggestion would be:
1 - in posts_revisions, do not prepend #{Monologue::Engine.routes.url_helpers.root_path} when generating a url

self.url = "{year}/#{self.title.parameterize}" if self.url.nil? || self.url.strip == ""

instead of

self.url = "#{Monologue::Engine.routes.url_helpers.root_path}#{year}/#{self.title.parameterize}" if self.url.nil? || self.url.strip == ""

2 - Then instead of using

use sthg like

The url are then consistent and do not depend on the mounted path.
Does it make sense?

@jipiboily
Owner

Would certainly make sense! Thanks for the suggestion.

@msevestre
Collaborator

I'll make a pull request :-)

@msevestre
Collaborator

hum..I just tried with prepending /monologue to my previous url. It still does not work.
The path looks like /monologue/blah but I still get a 404
Maybe a routing problem?

@jipiboily
Owner

PR #64 was merged. Thanks!

@jipiboily jipiboily closed this
@ShoaibRana

jquery validation is not working in monologue can somebody help plz???

@msevestre
Collaborator
@ShoaibRana

problem resolved and thakx msevestre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.