1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Extend actionSave()

Discussion in 'XenForo Development Discussions' started by Daniel Hood, Sep 24, 2013.

  1. Daniel Hood

    Daniel Hood Well-Known Member

    I'm working on an add on that requires changing a type of field, I've altered the table, I've extended the datawriter, the model, etc... My problem is the controller. I don't want to over-write the entire function obviously but I need change the type of input expected. I can't do it with the typical:

    $parent = parent::actionSave();
    $var = $parent->var;
    Because parent:: does stuff (some of which I need to modify) before returning. Any ideas?
  2. AndyB

    AndyB Well-Known Member

    Would it be practical to just run a query from your add-on to do what you want?
  3. KenSmith

    KenSmith Active Member

    Is there any way you could do it in your DataWriter's _preSave()?
    Marcus likes this.
  4. Daniel Hood

    Daniel Hood Well-Known Member

    That is a possible solution... @ both of you lol
  5. Jeremy

    Jeremy XenForo Moderator Staff Member

    I would try to do it within the preSave as KenSmith has suggested. Running queries in your datawriter that don't relate to the data you are modifying is general bad practice.

Share This Page