Skip to content

Commit

Permalink
merge with #7778
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed Sep 8, 2015
1 parent dd5e5aa commit 5d699e4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
11 changes: 6 additions & 5 deletions libraries/joomla/table/asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ public function loadByName($name)
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)
{
Expand All @@ -118,10 +122,7 @@ public function check()
$this->setError('Invalid Parent ID');

return false;
}
if (empty($this->rules))
{
$this->rules = '{}';

}
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/legacy/table/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
16 changes: 16 additions & 0 deletions libraries/legacy/table/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 5d699e4

Please sign in to comment.