diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2022-02-25 17:57:13 +0100 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2022-04-12 15:44:24 +0000 |
| commit | d6004f5d5668cbbaf60878e54e2c3c3848ce120b (patch) | |
| tree | 3cb81a3643315ab51bd26fd47e89c016b59f1387 /app/controllers/news.php | |
| parent | 917e75430696706e4ffb643d7154af8d60258742 (diff) | |
fixed PHP8 warnings in news/edit_newsphp8
Diffstat (limited to 'app/controllers/news.php')
| -rw-r--r-- | app/controllers/news.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/news.php b/app/controllers/news.php index 81e832e..1c60adf 100644 --- a/app/controllers/news.php +++ b/app/controllers/news.php @@ -178,6 +178,7 @@ class NewsController extends StudipController $this->area_options_selected = []; $this->may_delete = false; $this->route = "news/edit_news/{$id}"; + $this->anker = ''; $this->news_isvisible = [ 'news_basic' => true, @@ -207,7 +208,8 @@ class NewsController extends StudipController } // load news and comment data and check if user has permission to edit - $news = new StudipNews($id); + $this->comments = []; + $news = new StudipNews($id ?? null); if (!$news->isNew()) { $this->comments = StudipComment::GetCommentsForObject($id); } @@ -250,7 +252,7 @@ class NewsController extends StudipController if ($this->assigned){ $this->news_isvisible['news_visibility'] = true; } - } elseif ($id) { + } elseif (!empty($id)) { // if news id given check for valid id and load ranges if ($news->isNew()) { PageLayout::postError(_('Die Ankündigung existiert nicht!')); @@ -425,6 +427,7 @@ class NewsController extends StudipController } // prepare to save news if (Request::submitted('save_news') && Request::isPost()) { + $error = 0; CSRFProtection::verifySecurityToken(); //prepare ranges array for already assigned news_ranges foreach($news->getRanges() as $range_id) { |
