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

Lack of Interest Output throws error if a nodehandler doesn't exist

Discussion in 'Closed Suggestions' started by ragtek, Mar 26, 2011.

  1. ragtek

    ragtek Guest

    In XenForo_Model_Node::getNodeHandlersForNodeTypes you check if the handler class for the nodetypeid is set.
    If it isn't set, you set the classname as an empty string.
        public function getNodeHandlersForNodeTypes(array $nodeTypeIds)
    $nodeTypes $this->getAllNodeTypes();

    $output = array();
            foreach (
    $nodeTypeIds AS $nodeTypeId)
    $class = isset($nodeTypes[$nodeTypeId]) ? $nodeTypes[$nodeTypeId]['handler_class'] : '';
    $output[$nodeTypeId] = new $class();

    That brings an ugly fatal error
    if it's not set.
    IMHO this shouldn't brake the system.
    I know, this will only happen if the add-on deinstall code isn't deleting the existing nodes, but maybe you could use here a "empty alias node handler" class for this?

Share This Page