And the 404 after hitting post was generated for /orca/vanilla/post/comment/?discussionid=699
... and then I looked at that and said "Why the fuck is it trying to go into a Vanilla subdirectory?"
And sure enough, there's an empty Vanilla directory (from when I expanded the archive of 2.1.3 at some point) with nothing in it but an .htaccess file.
It was .htaccess - in that there was an .htaccess in a subdirectory under the main vanilla folder that was being read instead of the proper one. Yeeesh. Tricky.
Congrats; tricky bug. Sorry about the panic, that's never fun. Rest assured, the effort was worth it. There were some mean security issues you just patched.
Any thoughts on how I can address the issue that @peregrine has found? Is there a way to write an addon that would circumvent the change in 2.1 discussionscontroller and get the system to use my config settings?
This is the plugin I set up - it enables just fine.
<?php if (!defined('APPLICATION')) exit();
$PluginInfo['OrderByCreationDate'] = array(
'Name' => 'Order By Creation Date',
'Description' => 'This plugin causes all posts in the forum to show up in the order in which they were originally posted, rather than ordered by most recent comment.',
'Version' => '0.1',
'Author' => "doycet",
'AuthorEmail' => 'doyce.testerman@gmail.com',
'AuthorUrl' => 'http://vanillaforums.org/discussion/comment/215804'
);
class OrderByCreationDatePlugin extends Gdn_Plugin {
public function DiscussionModel_BeforeGet_Handler($Sender) {
$Wheres = $Sender->EventArguments['Wheres'];
if (!array_key_exists('d.CategoryID', $Wheres))
return;
$Sender->EventArguments['SortField'] = 'd.DateInserted';
$Sender->EventArguments['SortDirection'] = 'desc';
}
}
It doesn't seem to have any effect on the forum's list of posts at all, in any subforum.
I have the following plugins installed:
Add Text to Box
All Viewed
AutoBookmark
BetterNotifications
Button Bar
Custom Homepage
FileUpload
In This Discussion
Last Edited
MarkdownMarkup (forces Markdown to honor soft line breaks)
Comments
as an aside....
you should be able to see this in your apache logs
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Sure, but... .htaccess hasn't been "right", basically, ever, and it's been working fine.
Update:
New discussions can be posted without error.
Private messages can be replied to.
Only comments to existing discussions throw the 404.
do you see js errors anywhere.
and check your apache errorlog.
you could also try disabling all your plugins and see if you get error.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I updated the 404 file to kick out the requested URL.
Then, tried to post a reply to http://nila.edu/orca/discussion/699/
And the 404 after hitting post was generated for /orca/vanilla/post/comment/?discussionid=699
... and then I looked at that and said "Why the fuck is it trying to go into a Vanilla subdirectory?"
And sure enough, there's an empty Vanilla directory (from when I expanded the archive of 2.1.3 at some point) with nothing in it but an .htaccess file.
Son of a...
Deleted said directory, error goes away.
so you solved it! I take.
so, it was .htaccess after all?
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
sometimes copying doesn't copy hidden files e.g. with the dot. .htaccess
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
It was .htaccess - in that there was an .htaccess in a subdirectory under the main vanilla folder that was being read instead of the proper one. Yeeesh. Tricky.
Congrats; tricky bug. Sorry about the panic, that's never fun. Rest assured, the effort was worth it. There were some mean security issues you just patched.
No problem: every issue like this is an opportunity to
Now I just need to figure out what plugin is overriding the config setting where I try to order posts by creation rather than modification date.
@Linc and @hgtonight.
because if your forum was not > @Linc said:
Are you guys certain the Get method gets acted upon the GetWhere doesn't override it.
GetWhere always sorts by....
I see that the ->OrderBy('d.DateLastComment', 'desc')
I don't see how the sort could possibly work. with the config. maybe just me though
don't think it works as expected in 2.1
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I can also do this
$Configuration['Vanilla']['Discussions']['SortField'] = 'boo';
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Yeah, there's actually a line in the core that specifically looks for weird sortfields like that, so it can generate an error.
Lines 231 to 235 in class.discussionmodel.php
@Linc and @hgtonight.
because if your forum was not > @Linc said:
the Get has the configs but
the GetWhere has no concept of the orderby from config statments.
GetWhere always sorts by....
I see that the ->OrderBy('d.DateLastComment', 'desc')
I don't see how the sort works. with the config. maybe just me though
to me, this is where the control order happens
https://github.com/vanilla/vanilla/blob/2.1/applications/vanilla/models/class.discussionmodel.php#L282
and it the config statements are not acted upon or used here.
I would think you would need to change it to
$this->EventArguments['SortField'] = C('Vanilla.Discussions.SortField', 'd.DateLastComment');
$this->EventArguments['SortDirection'] = C('Vanilla.Discussions.SortDirection', 'desc');
and put variables for sort and direction in Line 282 after the configs are called.
If my reasoning is correct I'll post on github if you want, or you can
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
2.0.18 discussionscontroller
// Get Discussions
$this->DiscussionData = $DiscussionModel->Get($Page, $Limit);
2.1 discussionscontroller
// Get Discussions
$this->DiscussionData = $DiscussionModel->GetWhere(FALSE, $Offset, $Limit);
https://github.com/vanilla/vanilla/issues/2083
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Hi all,
Any thoughts on how I can address the issue that @peregrine has found? Is there a way to write an addon that would circumvent the change in 2.1 discussionscontroller and get the system to use my config settings?
Put this in a plugin:
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Just read in your first post you want to sort everything by creation.
In that case you can just omit the second condition on line 3:
oh and credits go to @hgtonight for this, I took it from my NillaBlog fork, but I probably got it from BlanderBlog in the first place
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
MAN this is a stubborn issue.
This is the plugin I set up - it enables just fine.
It doesn't seem to have any effect on the forum's list of posts at all, in any subforum.
I have the following plugins installed: