HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
What controls My Discussions in v3.3?
jitr
New
Your help with an unexpected snag, please..
I was aiming to clone My Discussions (url: /discussions/mine) to let's say My Chats (url: /discussions/chat). Each to display discussions from a separate set of categories.
The problem is that no change to $wheres or anything else I tried in function mine in class.discussionscontroller had an effect on the list of discussions on the screen. Not even complete removal of the function.
There must be something else but where to look?
Thank you.
0
Comments
The problem is that no change to $wheres or anything else I tried in function mine in class.discussionscontroller had an effect on the list of discussions on the screen. Not even complete removal of the function.
Please revert all that you did that way. You can achieve very heavy tweaking just by adding a plugin, never change existing files
Create a plugin and add a method discussionsController_chat_create($sender, $args). Take over as much as possible from an existing view, e.g. from DiscussionsController->index()
Replace the $this->render() with $sender->render('index', 'discussions', 'vanilla');
You need to replace references to $this with references to $sender. Start with small parts - I would indeed advice to start with only the render call in that method and then add the rest step by step. The first calls to /discussions/chat will fail because some data must be passed to the view, but you will be able to figure that out, I guess. If not, just ask again!
Just look what I have found! I really don't know why I have toyed around with it, but I threw together that sample at some day in the past. There is no real usecase for exactly that code, but it makes up a very good reference, I'd say!
As you might see, the bookmarked() method has been my "inspiration"
And certainly that: https://open.vanillaforums.com/addon/howtovanillapage-plugin 😎
The plugin standards have changed, so you should also read the docs: https://docs.vanillaforums.com/developer/addons/addon-info/
Thank you for this life saver, RJ.
Yes, a plugin, based on on Resolved Discussions, is the plan.
Tweak after not first!
@R_J Success. I applied your Bookmark model to My Discussions. Apart from one tweak it worked at once.
It took a while to find out what to tweak but Covid19 arrangements took up a huge amount of time last week.
A very big thank you.