diff --git a/libraries/joomla/table/asset.php b/libraries/joomla/table/asset.php index 37b8ddca433f5..01910f862badb 100644 --- a/libraries/joomla/table/asset.php +++ b/libraries/joomla/table/asset.php @@ -99,6 +99,10 @@ public function check() { $this->parent_id = (int) $this->parent_id; + if (empty($this->rules)) + { + $this->rules = '{}'; + } // JTableNested does not allow parent_id = 0, override this. if ($this->parent_id > 0) { @@ -118,10 +122,7 @@ public function check() $this->setError('Invalid Parent ID'); return false; - } - if (empty($this->rules)) - { - $this->rules = '{}'; + } } diff --git a/libraries/legacy/table/category.php b/libraries/legacy/table/category.php index be8a1e36cb4d1..506a6e0ad9204 100644 --- a/libraries/legacy/table/category.php +++ b/libraries/legacy/table/category.php @@ -227,7 +227,7 @@ public function store($updateNulls = false) // Verify that the alias is unique $table = JTable::getInstance('Category', 'JTable', array('dbo' => $this->getDbo())); - if ($table->load(array('alias' => $this->alias, 'parent_id' => $this->parent_id, 'extension' => $this->extension)) + if ($table->load(array('alias' => $this->alias, 'parent_id' => (int) $this->parent_id, 'extension' => $this->extension)) && ($table->id != $this->id || $this->id == 0)) { $this->setError(JText::_('JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS')); diff --git a/libraries/legacy/table/menu.php b/libraries/legacy/table/menu.php index 238cae7e8f3a3..747ca19aeb598 100644 --- a/libraries/legacy/table/menu.php +++ b/libraries/legacy/table/menu.php @@ -111,6 +111,22 @@ public function check() $this->alias = $this->title; } + // Check for a path. + if (trim($this->path) == '') + { + $this->path = $this->alias; + } + // Check for params. + if (trim($this->params) == '') + { + $this->params = '{}'; + } + // Check for img. + if (trim($this->img) == '') + { + $this->img = ' '; + } + // Make the alias URL safe. $this->alias = JApplication::stringURLSafe($this->alias);