Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix test key "type" if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Sep 1, 2017
1 parent 81567b0 commit 15b4ac0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions core/src/plugins/action.share/src/Store/ShareMetaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,16 @@ public function getSharesFromMeta($node, &$shares, $clearIfEmpty = false){
$shares = array();
$update = false;
foreach($meta["shares"] as $hashOrRepoId => $shareData){
$type = $shareData["type"];
if(is_array($type)) {
$shareData["type"] = $type[0];
}
if(!$clearIfEmpty || $this->shareStore->shareExists($shareData["type"],$hashOrRepoId)){
$shares[$hashOrRepoId] = $shareData;
}else{
$update = true;
if(isset($shareData["type"])) {
$type = $shareData["type"];
if (is_array($type)) {
$shareData["type"] = $type[0];
}
if (!$clearIfEmpty || $this->shareStore->shareExists($shareData["type"], $hashOrRepoId)) {
$shares[$hashOrRepoId] = $shareData;
} else {
$update = true;
}
}
}
if($update && !count($shares)){
Expand Down

0 comments on commit 15b4ac0

Please sign in to comment.