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

Fixed Style Import Error

Discussion in 'Resolved Bug Reports' started by Naatan, Apr 4, 2012.

  1. Naatan

    Naatan Well-Known Member

    Server Error

    Undefined index: parent_list
    1. XenForo_Application::handlePhpError() in XenForo/Model/StyleProperty.php at line 616
    2. XenForo_Model_StyleProperty->rebuildPropertyCacheInStyleAndChildren() in XenForo/DataWriter/Style.php at line 155
    3. XenForo_DataWriter_Style->_postSave() in XenForo/DataWriter.php at line 1385
    4. XenForo_DataWriter->save() in XenForo/Model/Style.php at line 527
    5. XenForo_Model_Style->importStyleXml() in XenForo/ControllerAdmin/Style.php at line 181
    6. XenForo_ControllerAdmin_Style->actionImport() in XenForo/FrontController.php at line 310
    7. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
    8. XenForo_FrontController->run() in /portal/www/admin.php at line 13
    TheVisitors, Yoskaldyr and guiltar like this.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Can you help me to reproduce this error? So far I haven't been able to. Any specific steps?
  3. Naatan

    Naatan Well-Known Member

    Sorry I'm no longer running the environment that had this problem, but if you look at the file mentioned (XenForo/Model/StyleProperty.php) at line 616 you can see that it's accessing the index 'parent_list', which if you look at line 604 could very well not have been defined. It's definitely a bug in XenForo, whether easily reproducible or not.
    TheVisitors likes this.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yeah I see that in the code. I just like to be able to reproduce the problem so I can fully test it and confirm a fix. You are right though:


    		foreach ($rebuildStyleIds AS $rebuildStyleId)
    			$sourceStyle = (isset($styles[$rebuildStyleId]) ? $styles[$rebuildStyleId] : array());
    			switch ($rebuildStyleId)
    				case 0:
    					continue 2;
    				case -1:
    					$sourceStyleIds = array(-1, 0);
    					$sourceStyleIds = explode(',', $sourceStyle['parent_list']);
    			$styleProperties = array();
    			foreach ($sourceStyleIds AS $sourceStyleId)
    				if (isset($properties[$sourceStyleId]))
    					$styleProperties = array_merge($styleProperties, $properties[$sourceStyleId]);
  5. Kier

    Kier XenForo Developer Staff Member

Share This Page