ImportedNode: improve link targets, fix rendering

refs #108
This commit is contained in:
Thomas Gelf 2017-02-16 14:05:16 +01:00
parent 369c52dfd4
commit f5d551bbf0
2 changed files with 7 additions and 5 deletions

View file

@ -23,7 +23,7 @@ class ImportedNode extends Node
protected $className = 'subtree';
/** @var BpConfig */
protected $config;
private $config;
/**
* @inheritdoc
@ -42,8 +42,6 @@ class ImportedNode extends Node
if (isset($object->state)) {
$this->setState($object->state);
} else {
$this->setMissing();
}
}
@ -101,8 +99,9 @@ class ImportedNode extends Node
*/
public function isMissing()
{
// TODO: WHY? return $this->getState() === null;
return $this->importedNode()->isMissing();
$this->getState();
// Probably doesn't work, as we create a fake node with worse state
return $this->missing;
}
/**

View file

@ -190,6 +190,9 @@ class NodeTile extends BaseElement
);
} else {
$link = Link::create($node->getAlias(), $url);
if ($node instanceof ImportedNode) {
$link->attributes()->add('data-base-target', '_next');
}
}
return $link;