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

Fixed Undefined index: propertyName

Discussion in 'Resolved Bug Reports' started by Romchik®, May 21, 2013.

  1. Romchik®

    Romchik® Well-Known Member

    Looks like just me have this problem?

    This occurs if I open any template.
     
  2. Mike

    Mike XenForo Developer Staff Member

    I'm not sure how that could happen.

    It's related to a 1.1.5 bug fix, but somehow the named captures don't seem to be there -- but this is something we use all over XF so I think you should've run into it before.

    I'd need FTP and admin access to try to debug it. (Best to submit a ticket with these details if possible, referencing this thread.)
     
  3. Pepelac

    Pepelac Well-Known Member

    Relatively simple if it is true what I've found on stackoverflow :)
     
    Mike, Romchik® and Yoskaldyr like this.
  4. Yoskaldyr

    Yoskaldyr Well-Known Member

    possible fix for php 5.2.x
    in file XenForo/Model/StyleProperty.php find
    PHP:
        protected static function _propertyToAtScalarCallback(array $match)
        {
    and replace with:
    PHP:
        protected static function _propertyToAtScalarCallback(array $match)
        {
            if (!isset(
    $match['propertyName']))
            {
                
    // if named backreferences not supported
                
    $match['propertyName'] = $match[2];
                if (isset(
    $match[3]))
                {
                    
    $match['propertyComponent'] = $match[3];
                }
            }
     
    Warning and Romchik® like this.
  5. Mike

    Mike XenForo Developer Staff Member

    Just using a simpler fix that seems to be ok (just always uses the numbered versions to be safe)

    Code:
    $match['propertyName'] = $match[2];
    $match['propertyComponent'] = isset($match[3]) ? $match[3] : null;
    I have updated the package to prevent this error.

    Good catch. :)
     

Share This Page