From 68f68c4d21b42463473b8fbcb5d8cf20e8f73174 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 21 May 2020 13:04:25 +0200 Subject: [PATCH] Support decorated `IPopoverObject` in anchor template plugin See #3318 --- .../template/plugin/AnchorFunctionTemplatePlugin.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() . '"'; } -- 2.20.1