Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion core/src/Controllers/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,16 @@ protected function parameterData()

if ($id > 0) {
if (!$data->exists) {
$this->managerTheme->alertAndQuit('No database record has been found for this template.');
// false: the message is the message, not a lexicon key - and a
// key that does not exist used to resolve to '', so this alert
// was empty. The URL is the page's own Cancel target: without
// one the alert falls back to history.back(-1), straight into
// the request that raised it.
$this->managerTheme->alertAndQuit(
'No database record has been found for this template.',
false,
'index.php?a=76&tab=0'
);
}

$_SESSION['itemname'] = $data->templatename;
Expand Down
4 changes: 2 additions & 2 deletions core/src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -3610,8 +3610,8 @@ public function webAlertAndQuit($msg, $url = '')
$style = '';
if (IN_MANAGER_MODE) {
$path = 'media/style/' . $this->getConfig('manager_theme') . '/';
if (is_file(EVO_MANAGER_PATH . $path . '/css/styles.min.css')) {
$file_name = '/css/styles.min.css';
if (is_file(EVO_MANAGER_PATH . $path . 'css/styles.min.css')) {
$file_name = 'css/styles.min.css';
} else {
$file_name = 'style.css';
}
Expand Down
15 changes: 12 additions & 3 deletions core/src/ManagerTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,21 @@ public function getCore(): CoreInterface
/**
* @inheritdoc
*/
public function alertAndQuit(string $message, $lexicon = true): void
/**
* @param string $message a lexicon key, or the message itself when $lexicon is false
* @param bool $lexicon whether $message is a key to look up
* @param string $url where to send the user after the alert. Empty means
* history.back(-1), which on a page that alerts as soon
* as it is opened returns to the page that alerts - a
* loop the user cannot leave. Pass a destination
* whenever the alert ends the page.
*/
public function alertAndQuit(string $message, $lexicon = true, string $url = ''): void
{
if ($lexicon) {
$message = $this->getLexicon($message);
$message = $this->getLexicon($message, $message);
}
$this->getCore()->webAlertAndQuit($message);
$this->getCore()->webAlertAndQuit($message, $url);
}

public function isLoadDatePicker(): bool
Expand Down