Object edit link led to the admin panel
authorMarcel Werk <burntime@woltlab.com>
Wed, 27 Jan 2021 16:14:41 +0000 (17:14 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 27 Jan 2021 16:14:41 +0000 (17:14 +0100)
wcfsetup/install/files/lib/form/ArticleAddForm.class.php

index 96a3480587b4389179c5a5ab67c2045fc8eced1f..71b37a847b9e14e46a095f350b82fc32cf9c3bdc 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\form;
 use wcf\data\article\Article;
+use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 use wcf\util\HeaderUtil;
 
@@ -35,5 +36,11 @@ class ArticleAddForm extends \wcf\acp\form\ArticleAddForm {
                        HeaderUtil::redirect($article->getLink());
                        exit;
                }
+               else {
+                       WCF::getTPL()->assign([
+                               // We need to reassign the link here because otherwise it will lead to the admin panel.
+                               'objectEditLink' => LinkHandler::getInstance()->getControllerLink(ArticleEditForm::class, ['id' => $article->getObjectID()]),
+                       ]);
+               }
        }
 }