Skip to content

Commit

Permalink
Merge pull request #459 from CONTENIDO/bug/458-error-message-is-not-d…
Browse files Browse the repository at this point in the history
…isplayed-in-backendeditfront_contentphp

#458 Error message is not displayed in backendedit/front_content.php
  • Loading branch information
muratpurc committed Feb 11, 2024
2 parents bb625de + ea2edf3 commit a07c7ab
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions contenido/external/backendedit/front_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,21 @@

$frontendPath = cRegistry::getFrontendPath();

// if directory does not exist, show error message
// If directory does not exist, show error message
if (!is_dir($frontendPath)) {
$notification = new cGuiNotification();
$notification->displayMessageBox(cGuiNotification::LEVEL_ERROR, i18n('The given client\'s frontend directory (%s) is not a directory.', $frontendPath));
exit;
// Don't use `cGuiNotification()` or `i18n()`, we don't have an initialized `$belang` at this stage!
die(sprintf(
'The given client\'s frontend directory (%s) is not a directory.'
. (isset($client) ? '' : ' !! \$client is not set !! Check your request parameters or session'),
$frontendPath
));
}
chdir($frontendPath);

$cfg = cRegistry::getConfig();
$cfgClient = cRegistry::getClientConfig();
$client = cRegistry::getClientId();

// Include the config file of the frontend to initialize client and language id
include_once($cfgClient[$client]['config']['path'] . '/config.php');

Expand All @@ -40,5 +47,3 @@

// Include article view handler
include(cRegistry::getBackendPath() . $cfg['path']['includes'] . 'frontend/include.front_content.php');

?>

0 comments on commit a07c7ab

Please sign in to comment.