- Affected App
- WoltLab Suite Core
Das wird in der Klasse zwar an sich richtig geprüft:
PHP: AclFormField
/**
* @inheritDoc
*/
public function getHtmlVariables() {
ACLHandler::getInstance()->assignVariables($this->getObjectType()->objectTypeID);
$includeAclJavaScript = !static::$includedAclJavaScript;
if (!static::$includedAclJavaScript) {
wcfDebug(new SystemException());
static::$includedAclJavaScript = true;
}
return [
'includeAclJavaScript' => $includeAclJavaScript
];
}
Display More
Blöd ist nur, dass $form->getHtml() im Template die Methode ein Mal für getHtml() aufruft, hier wird dann gesetzt, dass das JS geladen wurde, und erst dann wird getFieldHtml ausgeführt, dessen Template die Variable verwertet; diese ist dann aber leider falsch gesetzt.
PHP: AbstractFormField
/**
* @inheritDoc
*/
public function getFieldHtml() {
if ($this->templateName === null) {
throw new \LogicException("\$templateName property has not been set for class '" . static::class . "'.");
}
return WCF::getTPL()->fetch(
$this->templateName,
$this->templateApplication,
array_merge($this->getHtmlVariables(), [
'field' => $this
]),
true
);
}
/**
* @inheritDoc
*/
public function getHtml() {
if ($this->requiresLabel() && $this->getLabel() === null) {
throw new \UnexpectedValueException("Form field '{$this->getPrefixedId()}' requires a label.");
}
return WCF::getTPL()->fetch(
'__formField',
'wcf',
array_merge($this->getHtmlVariables(), [
'field' => $this
]),
true
);
}
Display More