Skip to content

Commit

Permalink
Added temporarily solution to prevent ANR lang change every time we u…
Browse files Browse the repository at this point in the history
…pdate ANR.
  • Loading branch information
Ruslan Baidan committed Feb 12, 2020
1 parent 4735caa commit 5f09e49
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Service/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ public function update($id, $data)
$this->filterPostFields($data, $entity);

$entity->setDbAdapter($this->get('table')->getDb());
$entity->setLanguage($this->getLanguage());
// TODO: Temporarily added hack to prevent the Anr lang change.
if (!$entity instanceof AnrSuperClass) {
$entity->setLanguage($this->getLanguage());
}

// Pass our new data to the entity. This might throw an exception if some data is invalid.
$entity->exchangeArray($data);
Expand Down Expand Up @@ -352,7 +355,10 @@ public function patch($id, $data)
}

$entity->setDbAdapter($this->get('table')->getDb());
$entity->setLanguage($this->getLanguage());
// TODO: Temporarily added hack to prevent the Anr lang change.
if (!$entity instanceof AnrSuperClass) {
$entity->setLanguage($this->getLanguage());
}
foreach ($this->dependencies as $dependency) {
if ((!isset($data[$dependency])) && ($entity->$dependency)) {
if($entity->$dependency->uuid)
Expand Down

0 comments on commit 5f09e49

Please sign in to comment.