Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Check if module route is present before checking if post or product page to avoid php warning

givanza3ba3de70997
diff --git a/admin/controller/editor/editor.php b/admin/controller/editor/editor.php
index 215f856..95103f4 100755
--- a/admin/controller/editor/editor.php
+++ b/admin/controller/editor/editor.php
@@ -197,19 +197,21 @@ class Editor extends Base {
$className = 'url';
$current_page = [];
- switch ($route['module']) {
- case 'product/product/index':
- $className = 'product';
- $current_page['product_id'] = $route['product_id'];
+ if ($route && isset($route['module'])) {
+ switch ($route['module']) {
+ case 'product/product/index':
+ $className = 'product';
+ $current_page['product_id'] = $route['product_id'];
- break;
+ break;
- case 'content/post/index':
- case 'content/page/index':
- $className = 'page';
- $current_page['post_id'] = $route['post_id'];
+ case 'content/post/index':
+ case 'content/page/index':
+ $className = 'page';
+ $current_page['post_id'] = $route['post_id'];
- break;
+ break;
+ }
}
$key = slugify($url);