I am writing an addon that overrides the XenForo_ViewPublic_Thread_ViewNewPosts class, to allow for filtering based on user. If anyone (as I understand it) for any other reason, even if they don't change the output, writes another mod that overrides the same class there is a conflict. That's not an argument, it's fact. However, what I'm asking is if/how the XenForo team, or other addon authors, deals with this.
It's possible I haven't dug deep enough yet, or missed someway on sharing the output that is already built into the system.
Conflicts are really down to add-on authors to work out between each other.
It seems like it is possible for the really good coders to avoid stepping on each other's toes.In your case (note: I haven't looked in code), you'd want to call the parent with modified instructions (take out certain node_ids) and perform the query. You set the modified parameters and call return parent::function(args);. If two functions extend it, add-on b will now take over and perform the necessary modifications for that add-on and pass it's modifications up the line. By the time you get to the actual query, every add-on will have gotten the desired effect and XenForo can perform the query, returning the results expected by all.
Should this be page one in the "Newbie's Guide to Addons" ?It's a clever system. Conflicts can still occur, but my main confusion/concern (that conflicts where inevitable) was based on a lack of understanding of how the addon system dynamically extends classes, which in my defense is somewhat unique
If XenForo develops and writes the software correctly on all the queries, it should be easy for even novice programmers to avoid stepping on each other's toes. The system is intuitive enough to avoid these. Most conflicts are simple and easy enough for a single author to modify their code to fix the conflict.It seems like it is possible for the really good coders to avoid stepping on each other's toes.
It's easy enough to fix, write you're add-on, and if there is a conflict, you can deal with it later. It's relatively easy.It's a clever system. Conflicts can still occur, but my main confusion/concern (that conflicts where inevitable) was based on a lack of understanding of how the addon system dynamically extends classes, which in my defense is somewhat unique
If XenForo develops and writes the software correctly on all the queries, it should be easy for even novice programmers to avoid stepping on each other's toes. The system is intuitive enough to avoid these. Most conflicts are simple and easy enough for a single author to modify their code to fix the conflict.
We use essential cookies to make this site work, and optional cookies to enhance your experience.