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

As Designed Undefined variable: errorPhraseKey

Discussion in 'Resolved Bug Reports' started by Onimua, Mar 21, 2011.

  1. Onimua

    Onimua Well-Known Member

    At this line:
    if (!$this->getInlineModTypeModel()->$functionName($ids$options$errorPhraseKey))
    It seems XenForo_ControllerPublic_InlineMod_Abstract::executeInlineModAction doesn't define $errorPhraseKey. I added $errorPhraseKey = '' to the end and it seems to stop complaining, though not sure if I should pass it by reference or not but I don't see a difference on the front-end.
  2. Kier

    Kier XenForo Developer Staff Member

    $errorPhraseKey should be passed by reference and defaulted to '' in the function signature for whatever you specify as $functionName - it's created on demand.
    public function myFunction(array $ids, array $options = array(), &$errorPhraseKey, array $viewingUser null)
    See functions such as XenForo_Model_Thread::canEditPoll() and XenForo_Model_InlineMod_Post::deletePosts() for examples of this pattern in use.
    Onimua likes this.
  3. Onimua

    Onimua Well-Known Member

    I went back and actually did this and now it works, but I'm a bit confused as to what I actually did that wasn't working before. :confused:
    I may need to sleep more often...
    Kier likes this.

Share This Page