Wedge

Public area => Bug reports => The Pub => Archived fixes => Topic started by: live627 on May 29th, 2013, 11:09 AM

Title: A plugin must declare an action the long way
Post by: live627 on May 29th, 2013, 11:09 AM
I see
Quote
// Remember, if the function is the same as the filename, you may declare it just once.
iin the man index file. However, a plugin must still declare their action the long way.

Note that this isn't through the XML interface.
Title: Re: A plugin must declare an action the long way
Post by: Arantor on May 29th, 2013, 04:15 PM
Um, why aren't you using the XML interface? Just curious.
Posted: May 29th, 2013, 02:47 PM

So I looked at this and realised that by necessity it must do that seeing how it needs all three parameters to be able to get the plugin id. But in almost every case a plugin should be using the XML interface; it should only ever need the hook directly if it's going to dynamically generate actions that aren't pre-known at the point of registering the plugin.
Title: Re: A plugin must declare an action the long way
Post by: Dragooon on May 29th, 2013, 05:49 PM
Which can be a fairly common occurrence for something like a dynamic portal.
Title: Re: A plugin must declare an action the long way
Post by: Arantor on May 29th, 2013, 06:00 PM
Would a portal really be creating its own *dynamic actions*? I haven't seen any portal do that for SMF. Static actions (action=forum) and pages (page=x), yes, but not dynamically allocated action=item.

And for those rare cases it's going to happen, doing it the long way really is a minor deal, no?

Mind you, I've made it clear that I want to see a CMS of sorts in the core in more recent times, so I'm not really sensing this to be a real world problem ;)
Title: Re: A plugin must declare an action the long way
Post by: live627 on May 30th, 2013, 01:32 AM
Just an irregularity. Also, if someone points this out in the future, we can then direct them to this topic.