From: Matthias Schmidt Date: Thu, 21 May 2020 11:04:25 +0000 (+0200) Subject: Support decorated `IPopoverObject` in anchor template plugin X-Git-Tag: 5.3.0_Alpha_1~289 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=68f68c4d21b42463473b8fbcb5d8cf20e8f73174;p=GitHub%2FWoltLab%2FWCF.git Support decorated `IPopoverObject` in anchor template plugin See #3318 --- diff --git a/wcfsetup/install/files/lib/system/template/plugin/AnchorFunctionTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/AnchorFunctionTemplatePlugin.class.php index 8e4faec7e3..1f517bdad0 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/AnchorFunctionTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/AnchorFunctionTemplatePlugin.class.php @@ -109,7 +109,11 @@ class AnchorFunctionTemplatePlugin implements IFunctionTemplatePlugin { $additionalParameters .= ' ' . strtolower(preg_replace('~([A-Z])~', '-$1', $name)) . '="' . StringUtil::encodeHTML($value) . '"'; } - if ($object !== null && $object instanceof IPopoverObject && in_array($object->getPopoverLinkClass(), $classes)) { + if ( + $object !== null + && ($object instanceof IPopoverObject || ClassUtil::isDecoratedInstanceOf($object, IPopoverObject::class)) + && in_array($object->getPopoverLinkClass(), $classes) + ) { $additionalParameters .= ' data-object-id="' . $object->getObjectID() . '"'; }