<option value="0">{lang}wcf.global.noSelection{/lang}</option>
{foreach from=$pageNodeList item=pageNode}
- <option value="{@$pageNode->pageID}"{if $pageNode->pageID == $pageID} selected{/if} data-identifier="{@$pageNode->identifier}">{if $pageNode->getDepth() > 1}{@" "|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->name}</option>
+ {if !$pageNode->requireObjectID || $pageHandlers[$pageNode->pageID]|isset}
+ <option value="{@$pageNode->pageID}"{if $pageNode->pageID == $pageID} selected{/if} data-identifier="{@$pageNode->identifier}">{if $pageNode->getDepth() > 1}{@" "|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->name}</option>
+ {/if}
{/foreach}
</select>
{if $errorField == 'pageID'}
}
// validate page object id
- if (isset($this->pageHandlers[$page->pageID])) {
- if ($this->pageHandlers[$page->pageID] && !$this->pageObjectID) {
- throw new UserInputException('pageObjectID');
+ if ($page->requireObjectID) {
+ if (isset($this->pageHandlers[$page->pageID])) {
+ if ($this->pageHandlers[$page->pageID] && !$this->pageObjectID) {
+ throw new UserInputException('pageObjectID');
+ }
+
+ /** @var ILookupPageHandler $handler */
+ $handler = $page->getHandler();
+ if ($this->pageObjectID && !$handler->isValid($this->pageObjectID)) {
+ throw new UserInputException('pageObjectID', 'invalid');
+ }
}
-
- /** @var ILookupPageHandler $handler */
- $handler = $page->getHandler();
- if ($this->pageObjectID && !$handler->isValid($this->pageObjectID)) {
- throw new UserInputException('pageObjectID', 'invalid');
+ else {
+ // page requires an object id, but no handler is registered
+ throw new UserInputException('pageID', 'invalid');
}
}
}