Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla 2.5 Articles
kopna
✭
how to fix this error
0
Comments
sorry, updated the version, it not works
Here is the fix for that: https://github.com/austins/Vanilla-App-Articles/commit/a83d18c589e3731ae9345119ae247f507b05dc98
You should be able to install it with this fix, but Articles doesn't support Vanilla 2.5 yet. Some links will not work and there will be design issues. I will work on an update when I get time.
Add Pages to Vanilla with the Basic Pages app
@Shadowdare thanks for the answer
I will wait for the application update
I repeat my preference of using a new discussion type rather than an entirety separate application. I believe it will better integrate with all the other plugins, be more compatible and in the long run simpler to maintain.
@rbrahmson, I may revisit the idea in the future. Both ways have their own benefits. I haven't checked, but it's possible that the new dashboard might make it easier to configure discussion types for each category unlike previous versions, which was a factor in going the standalone way.
Add Pages to Vanilla with the Basic Pages app
I had no hesitation of using a different discussion type in my FeedDiscussionPlus plugin (imported discussions has a "Feed" type). I also use my filter discussion plugin to create filtered discussion lists so it's easy for me to only look at feeds (or not) based on the type. All in 2.3 (I still have to try matters in 2.5)
@Shadowdare, This is such a great plugin... any plans on updating it for 2.5.1?
I'm revisiting this discussion type concept. The main advantages would be immediate support for Vanilla discussion features, such as bookmarks, notifications, permissions system, and moderation. Additionally, addons that modify discussions, such as Yaga, would work without any modification. Articles can show up in discussion indexes, increasing visibility of new comments and promoting more discussion. Furthermore, it may be cleaner just to use the built-in Media model for thumbnails and so on.
Adding a new discussion type has some quirks, but I hope we can make it work.
This project would introduce "breaking changes" and proper instructions on upgrading would need to be written and carefully followed by admins. An export/import script would probably have to be made.
Add Pages to Vanilla with the Basic Pages app
The issue of which discussion types to display and where (and when) could be handled with filters. In our intranet we did it with the filter discussion plugin but of course it could be done within the articles app/plugin itself.
Until such time where plugin developers get stats on how many users actually use their plugins I'd consider not coding the migration script.
I already put together a new test addon for this concept to see how it goes. I store article metadata in a table called Article with columns ArticleID, DiscussionID, UrlCode, Excerpt, and Status. More fields can be added later such as thumbnail media ID. Discussions are saved from the /post/article page with "Article" in their Type column.
One implementation of joining the article metadata:
Plugin event handler
ArticleModel
The above event handler is run after the discussion query get and it works thanks to the setCalculatedFields event that's fired in every get method in DiscussionModel. However, the results can't be filtered before pagination.
The best way to filter discussion queries is to join the data before the query is run so we can add in proper wheres statements that will provide proper results before pagination (see below), but it seems to have some quirks as well because it seems like beforeGet event gets called on nearly every method except getID. There is an event in getID, but it's before the SQL statement gets built, unless you can set a where clause before that out-of-order? Of course, this would attach these properties to all discussion objects; there probably won't be conflicts with the names, but a prefix can easily be added.
Anyway, I'm not sure if we need to join the actual query yet as I haven't got to the point in this test addon I just created to need to filter the results pre-query. Could probably use
d.Type != 'Article'
.Add Pages to Vanilla with the Basic Pages app
Why dealing with joins when the articles themselves can be discussions with type "discussion"? Also, you could similarly handle versioning in comments under the discussion (filtering/hiding as you see fit). I'd go all the way into discussions....
I have a join table for article metadata because I don't want to clutter the discussion table with extra columns that many other discussions won't be using and it's nicer than using the discussion built-in serialized attributes column for sure.
Another issue I just thought of is the article workflow. Discussions already have drafts, which don't get saved as real discussions, but as an entry in the "Draft" table/model. Have you ever tried to create a Q&A post, save it as a draft, but come back to the draft and it gets converted into a normal discussion? I submitted an issue/pull-request a while ago to add "Type" column to the built-in Drafts as it doesn't store that, but it hasn't been implemented.
I'm thinking of going around this by removing the "save draft" button and just sticking with the style that the current Articles app has. This would probably require the pre-query join in order to filter the results based on article status.
Trying to discuss out potential quirks, edge cases, and anything that may prevent functionality that I hope to have in an articles addon. If it works out, I hope to keep it as Vanilla as possible apart from having to copy some code here and there and possibly having to hack a few things, but it should be more awesome than the non-discussion-type way.
Add Pages to Vanilla with the Basic Pages app
@rbrahmson, better go all-in on discussions. One of the reasons back then was maybe someone wants to just have a blog that runs better than WordPress and not a forum, but it's clear that, while Vanilla is built upon Garden framework, it's meant to stay enabled, so separation from forum isn't a necessary point now.
Thank you Are you using Articles in production? I use Articles on a website where I replaced WordPress with 100% Vanilla and it's definitely made everything awesome nonetheless, but I would like to get something out for Vanilla 2.5+ too so we all can upgrade.
Add Pages to Vanilla with the Basic Pages app
One of the unreleased plugins we have in our intranet has a work flow implementation. It's sort of a support system where "discussions" are assigned to users. We did it by adding an "assignee" column to the discussion table and change the value in that field by user actions and rules derived from another table. Assignees see their "tasks" through filters on that column. Dialogs regarding the "case" are stored in the normal content. Very simple and clean.
You may consider a variant of that concept.
I wouldn't use the vanilla"draft" state as your article draft state. While the word is the same the meaning in the article app is different. Vanilla draft state is the state before the discussion "article" is created. Your article draft state is until it is published. So rather than hiding it I'd consider renaming it so that the terms wouldn't be confusing to the user. As for the articles draft state, I'd store the "state" in a new discussion table column where you may keep the article state (draft, published, in review, etc.)
Are you speaking of
You can use
discussionModel_beforeGetID_handler($sender) {
and then$sender->SQL->where...
without a problem. I've done that in one of my never released plugins and Bleistivt did this in his UnsubscribeDiscussion plugin.But is getID really a problem? When a dedicated "discussion" is requested and it is an article, shouldn't the request be made from an Article page? Was that understandable?
When drafts are a problem, why not create a second Articles category called "Drafts"? That would ensure that no information is lost which can be part of an Article.
Absolutely right, @R_J. Yeah, there will still be special controllers for articles, especially since they'll require a little bit of different views than normal discussions.
The code may be useful to join the article data--perhaps prefix it like "ArticleExcerpt" but still keep it stored in the extra table--in case I want to filter out the articles from the discussion results for some features and views. The performance impact of a small join over many discussions is likely minuscule.
I'll see what I can come up with.
Add Pages to Vanilla with the Basic Pages app
Hey @Shadowdare is there something planned ?