Skip to content

Commit

Permalink
On save error editor will reload with last selected settings for Topi…
Browse files Browse the repository at this point in the history
…c Control

Fixed issue #1013
  • Loading branch information
eSilverStrike committed Mar 15, 2022
1 parent 7a774c1 commit f4abe0d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions public_html/admin/plugins/staticpages/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,15 @@ function staticpageeditor_form(array $A)
if (empty($sp_id) && $mode == 'edit') { // means new
$topic_sp_id = '';
}

$sp_template->set_var('topic_selection',
TOPIC_getTopicSelectionControl('staticpages', $topic_sp_id, true, false, true, true, 2));

if ($mode == $LANG_ADMIN['save']) { // This can happen if error on save for example with missing data like title
// Reload from control on page
$sp_template->set_var('topic_selection',
TOPIC_getTopicSelectionControl('staticpages', '', true, false, true, true, 2));
} else {
$sp_template->set_var('topic_selection',
TOPIC_getTopicSelectionControl('staticpages', $topic_sp_id, true, false, true, true, 2));
}
} else {
$sp_template->set_var('topic_selection',
TOPIC_getTopicSelectionControl('staticpages', $A['clone_sp_id'], true, false, true, true, 2));
Expand Down

0 comments on commit f4abe0d

Please sign in to comment.