Skip to content

Commit

Permalink
Merge pull request #8953 from infograf768/savecopy_assoc2
Browse files Browse the repository at this point in the history
Simplifying #8918 and solving Notice
  • Loading branch information
wilsonge committed Jan 21, 2016
2 parents 511a0c2 + 2316868 commit d1ccb9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions libraries/legacy/controller/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,14 +659,9 @@ public function save($key = null, $urlVar = null)
return false;
}

// Reset the ID and then treat the request as for Apply.
// Reset the ID, the multilingual associations and then treat the request as for Apply.
$data[$key] = 0;

// Reset multilingual associations if necessary
if (isset($data['associations']) && array_sum($data['associations']) != 0)
{
$data['associations'] = array();
}
$data['associations'] = array();
$task = 'apply';
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/legacy/model/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ public function save($data)

$this->setState($this->getName() . '.new', $isNew);

if ($this->associationsContext && JLanguageAssociations::isEnabled())
if ($this->associationsContext && JLanguageAssociations::isEnabled() && !empty($data['associations']))
{
$associations = $data['associations'];

Expand Down

0 comments on commit d1ccb9c

Please sign in to comment.