Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
small1 committed Jul 1, 2019
2 parents 28499f4 + 452f1e0 commit 1f4129b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2189,7 +2189,7 @@

_updateDirectoryPermissions: function() {
var isCreatable = (this.dirInfo.permissions & OC.PERMISSION_CREATE) !== 0 && this.$el.find('#free_space').val() !== '0';
this.$el.find('#permissions').val(permissions);
this.$el.find('#permissions').val(this.dirInfo.permissions);
this.$el.find('.creatable').toggleClass('hidden', !isCreatable);
this.$el.find('.notCreatable').toggleClass('hidden', isCreatable);
},
Expand Down
22 changes: 16 additions & 6 deletions lib/private/Comments/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ protected function normalizeDatabaseData(array $data) {
return $data;
}


/**
* @param array $data
* @return IComment
*/
public function getCommentFromData(array $data): IComment {
return new Comment($this->normalizeDatabaseData($data));
}

/**
* prepares a comment for an insert or update operation after making sure
* all necessary fields have a value assigned.
Expand Down Expand Up @@ -253,7 +262,8 @@ public function get($id) {
throw new NotFoundException();
}

$comment = new Comment($this->normalizeDatabaseData($data));

$comment = $this->getCommentFromData($data);
$this->cache($comment);
return $comment;
}
Expand Down Expand Up @@ -308,7 +318,7 @@ public function getTree($id, $limit = 0, $offset = 0) {

$resultStatement = $query->execute();
while ($data = $resultStatement->fetch()) {
$comment = new Comment($this->normalizeDatabaseData($data));
$comment = $this->getCommentFromData($data);
$this->cache($comment);
$tree['replies'][] = [
'comment' => $comment,
Expand Down Expand Up @@ -367,7 +377,7 @@ public function getForObject(

$resultStatement = $query->execute();
while ($data = $resultStatement->fetch()) {
$comment = new Comment($this->normalizeDatabaseData($data));
$comment = $this->getCommentFromData($data);
$this->cache($comment);
$comments[] = $comment;
}
Expand Down Expand Up @@ -455,7 +465,7 @@ public function getForObjectSince(

$resultStatement = $query->execute();
while ($data = $resultStatement->fetch()) {
$comment = new Comment($this->normalizeDatabaseData($data));
$comment = $this->getCommentFromData($data);
$this->cache($comment);
$comments[] = $comment;
}
Expand Down Expand Up @@ -485,7 +495,7 @@ protected function getLastKnownComment(string $objectType,
$result->closeCursor();

if ($row) {
$comment = new Comment($this->normalizeDatabaseData($row));
$comment = $this->getCommentFromData($row);
$this->cache($comment);
return $comment;
}
Expand Down Expand Up @@ -532,7 +542,7 @@ public function search(string $search, string $objectType, string $objectId, str
$comments = [];
$result = $query->execute();
while ($data = $result->fetch()) {
$comment = new Comment($this->normalizeDatabaseData($data));
$comment = $this->getCommentFromData($data);
$this->cache($comment);
$comments[] = $comment;
}
Expand Down
1 change: 0 additions & 1 deletion tests/ui-regression/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"author": "",
"dependencies": {
"chai": "^4.1.2",
"fs": "0.0.1-security",
"mocha": "^5.2.0",
"mocha-json-report": "0.0.2",
"pixelmatch": "^5.0.2",
Expand Down

0 comments on commit 1f4129b

Please sign in to comment.