2

I found some errors in the code of a third-party system plugin, it is assumed that the developer will release updates and fix them, but for today I would like to fix them myself, for this I made my system plugin, in which I want to fix these methods. Not the whole class, but the methods. It is supposed to use something like a decorator. I understand that you need to do this in the system plugin and I did it. Can this be implemented in this way?

class PlgOverride extends PlgAnotherExtension
{
    public function fixMehodName($type, $data)
    {
        // my code

        return parent::fixMehodName($type, $data);
    }
}

The official documentation https://docs.joomla.org/Plugin/Events/System says about events through which you can influence, but everywhere we are talking about replacing the entire class and only about kernel files or components or modules and not plugins.

  • Welcome to JSE, please take our tour. Can you perhaps be more specific about your actual requirements? Giving context around the actual task that you are undertaking may allow volunteers to offer alternative solutions and/or be more specific about their instructions when they answer. Theses look related: joomla.stackexchange.com/a/14072/12352 , joomla.stackexchange.com/q/7189/12352 , docs.joomla.org/… – mickmackusa Jul 8 at 8:49
  • Thanks. I apologize for the delay in responding. Update post. I re-read a lot of resources and from all the material, I realized that there is no way to rewrite part of the third-party plugin class in the Joomla. I do not see the normal solution as using str_replace and the like when loading classes. Although such variants have . – Dmitry Zar Jul 8 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.