I still have this problem, Vanilla version 2.03 and RewriteUrls = False. It needs to be false because the Apache config on the server the forum is on does not support URL rewrites so turning it on breaks the forum.
I too was having the problem with the blockquote HTML not being inserted. I ran it with Firebug enabled, and saw that there was a missing '/' between my forum's root URL and the getquote request part of the URL, e.g. it looked like:
example.com/forumplugin/quotes/getquote/Comment_2
After editing the plugin file js/quotes.js line 65 from:
var QuotebackURL = gdn.definition('WebRoot')+'plugin/quotes/getquote/'+QuotedElement;
to:
var QuotebackURL = gdn.definition('WebRoot')+'/plugin/quotes/getquote/'+QuotedElement;
(i.e. added a '/' between the webroot and the rest), it seems to submit a proper request for the quoted text and in turn inserts the blockquote.
2.0.4 will fix this bug. AJAX is basically broken in 2.0.3 with RewriteUrls = FALSE
Updated to 2.0.4, running with RewriteUrls = TRUE, just as I did under 2.0.3. Still having the same problem. None of the other solutions in this thread has helped, either
For what it's worth, I got this add-on to work for me by changing line 65 of quotes.js to:
var QuotebackURL = gdn.definition('WebRoot')+'/index.php?p=/plugin/quotes/getquote/'+QuotedElement; I would think that gdn.definition('WebRoot') would return the root with the /index.php?p= on it, but I guess not?
At any rate, this seems to be a problem with a lot of ajax plugins but once you understand what's happening, at least they're all easy to fix.
According to the code you should be able to set the WebRoot configuration directive in config.php (so you should be able to just hard code your forum root with a trailing slash there) but that directive is not being read properly as far as I can tell.
I don't think that is this plugin's fault as it seems to be using the API correctly.
@ithcy I'm not setting the WebRoot now, as it seems to be picked up fine automatically. It seems problematic to hard-code a webroot just for a trailing slash. Does this imply that the Vanilla code itself should be giving WebRoot with a trailing slash? Perhaps that is what you are saying; sorry if I'm not understanding...
I do think it would make more sense if WebRoot always had a trailing slash, since then adding a path to it would work whether or not the additional path started with a slash.
Comments
What version of vanilla are you using, and are you using RewriteUrls = TRUE?
Vanilla Forums COO [GitHub, Twitter, About.me]
Vanilla Forums COO [GitHub, Twitter, About.me]
Vanilla Forums COO [GitHub, Twitter, About.me]
You might try changing the js/quotes.js file like I mention above (link), and see if that helps. I don't think it could hurt, anyway.
Vanilla Forums COO [GitHub, Twitter, About.me]
var QuotebackURL = gdn.definition('WebRoot')+'/index.php?p=/plugin/quotes/getquote/'+QuotedElement;
I would think that gdn.definition('WebRoot') would return the root with the /index.php?p= on it, but I guess not?
At any rate, this seems to be a problem with a lot of ajax plugins but once you understand what's happening, at least they're all easy to fix.
Sorry for making a fuss
According to the code you should be able to set the WebRoot configuration directive in config.php (so you should be able to just hard code your forum root with a trailing slash there) but that directive is not being read properly as far as I can tell.
I don't think that is this plugin's fault as it seems to be using the API correctly.
I'm not setting the WebRoot now, as it seems to be picked up fine automatically. It seems problematic to hard-code a webroot just for a trailing slash. Does this imply that the Vanilla code itself should be giving WebRoot with a trailing slash? Perhaps that is what you are saying; sorry if I'm not understanding...
I do think it would make more sense if WebRoot always had a trailing slash, since then adding a path to it would work whether or not the additional path started with a slash.
Whatever moron wrote this plugin@Tim needs to use the new gdn.url() function that Todd wrote, which will fix the issue.Vanilla Forums COO [GitHub, Twitter, About.me]
Would it be gdn.url, or gdn.combinePaths...?
Perhaps I'm not understanding gdn.url...