Support decorated `IPopoverObject` in anchor template plugin
authorMatthias Schmidt <gravatronics@live.com>
Thu, 21 May 2020 11:04:25 +0000 (13:04 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 21 May 2020 11:04:25 +0000 (13:04 +0200)
See #3318

wcfsetup/install/files/lib/system/template/plugin/AnchorFunctionTemplatePlugin.class.php

index 8e4faec7e3cdc0896a3f046b8e9c0b1fca99f896..1f517bdad0eed8a53bfaf7e00cc590fa317ce0e8 100644 (file)
@@ -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() . '"';
                }