Convert article links during html processing in ACP
authorMatthias Schmidt <gravatronics@live.com>
Fri, 25 Aug 2017 05:44:17 +0000 (07:44 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 25 Aug 2017 05:44:17 +0000 (07:44 +0200)
com.woltlab.wcf/eventListener.xml
wcfsetup/install/files/lib/system/event/listener/ArticleLinkHtmlInputNodeProcessorListener.class.php

index f09ad68d932941f07eb560a83a170e7a41bd45c4..34be21dee66c060dfc0765b4f7507a39c5bf4f99 100644 (file)
                        <eventname>afterProcess</eventname>
                        <listenerclassname>wcf\system\event\listener\ArticleLinkHtmlInputNodeProcessorListener</listenerclassname>
                </eventlistener>
+               <eventlistener name="articleLinkhtmlInputNodeProcessorAdmin">
+                       <eventclassname>wcf\system\html\input\node\HtmlInputNodeProcessor</eventclassname>
+                       <eventname>afterProcess</eventname>
+                       <listenerclassname>wcf\system\event\listener\ArticleLinkHtmlInputNodeProcessorListener</listenerclassname>
+                       <environment>admin</environment>
+               </eventlistener>
        </import>
        
        <delete>
index d9cbbb06e4356fb8abea191ab3610cf4d5e4abb5..06e16d750552e65fc0d31f1cab87f7e3f0a9a579 100644 (file)
@@ -21,7 +21,9 @@ class ArticleLinkHtmlInputNodeProcessorListener extends AbstractHtmlInputNodePro
        public function execute($eventObj, $className, $eventName, array &$parameters) {
                /** @var HtmlInputNodeProcessor $eventObj */
                
-               $regex = $this->getRegexFromLink(LinkHandler::getInstance()->getLink('Article'));
+               $regex = $this->getRegexFromLink(LinkHandler::getInstance()->getLink('Article', [
+                       'forceFrontend' => true
+               ]));
                $articleContentIDs = $this->getObjectIDs($eventObj, $regex);
                
                if (!empty($articleContentIDs)) {