Skip to content

Commit

Permalink
Another approach to force boolean to int
Browse files Browse the repository at this point in the history
  • Loading branch information
dartcafe committed Oct 25, 2020
1 parent 21c51b1 commit c7929db
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 26 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<name>Polls</name>
<summary>A polls app, similar to doodle/dudle with the possibility to restrict access.</summary>
<description>A polls app, similar to doodle/dudle with the possibility to restrict access (members, certain groups/users, hidden and public).</description>
<version>1.5.6</version>
<version>1.5.7</version>
<licence>agpl</licence>
<author>Vinzenz Rosenkranz</author>
<author>René Gieling</author>
Expand Down
24 changes: 4 additions & 20 deletions lib/Db/Poll.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,34 +141,18 @@ public function jsonSerialize() {
];
}

public function setAnonymous($value) {
$this->anonymous = intval($value);
}

public function setAllowMaybe($value) {
$this->allowMaybe = intval($value);
}

public function setAdminAccess($value) {
$this->adminAccess = intval($value);
}

public function setImportant($value) {
$this->important = intval($value);
}

public function deserializeArray($array) {
$this->setTitle(isset($array['title']) ? $array['title'] : $this->getTitle());
$this->setDescription(isset($array['description']) ? $array['description'] : $this->getDescription());
$this->setAccess(isset($array['access']) ? $array['access'] : $this->getAccess());
$this->setExpire(isset($array['expire']) ? $array['expire'] : $this->getExpire());
$this->setAnonymous(isset($array['anonymous']) ? $array['anonymous'] : $this->getAnonymous());
$this->setAllowMaybe(isset($array['allowMaybe']) ? $array['allowMaybe'] : $this->getAllowMaybe());
$this->setAnonymous(isset($array['anonymous']) ? +$array['anonymous'] : $this->getAnonymous());
$this->setAllowMaybe(isset($array['allowMaybe']) ? +$array['allowMaybe'] : $this->getAllowMaybe());
$this->setVoteLimit(isset($array['voteLimit']) ? $array['voteLimit'] : $this->getVoteLimit());
$this->setShowResults(isset($array['showResults']) ? $array['showResults'] : $this->getShowResults());
$this->setDeleted(isset($array['deleted']) ? $array['deleted'] : $this->getDeleted());
$this->setAdminAccess(isset($array['adminAccess']) ? $array['adminAccess'] : $this->getAdminAccess());
$this->setImportant(isset($array['important']) ? $array['important'] : $this->getImportant());
$this->setAdminAccess(isset($array['adminAccess']) ?+ $array['adminAccess'] : $this->getAdminAccess());
$this->setImportant(isset($array['important']) ? +$array['important'] : $this->getImportant());
return $this;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "polls",
"description": "Polls app for nextcloud",
"version": "1.5.6",
"version": "1.5.7",
"authors": [
{
"name": "Vinzenz Rosenkranz",
Expand Down
8 changes: 4 additions & 4 deletions src/js/components/SideBar/SideBarTabConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export default {
return (this.poll.anonymous > 0)
},
set(value) {
this.writeValue({ anonymous: value })
this.writeValue({ anonymous: +value })
},
},
Expand All @@ -221,7 +221,7 @@ export default {
return (this.poll.important > 0)
},
set(value) {
this.writeValue({ important: value })
this.writeValue({ important: +value })
},
},
Expand All @@ -230,7 +230,7 @@ export default {
return (this.poll.adminAccess > 0)
},
set(value) {
this.writeValue({ adminAccess: value })
this.writeValue({ adminAccess: +value })
},
},
Expand All @@ -239,7 +239,7 @@ export default {
return this.poll.allowMaybe
},
set(value) {
this.writeValue({ allowMaybe: value })
this.writeValue({ allowMaybe: +value })
},
},
Expand Down

0 comments on commit c7929db

Please sign in to comment.