Prevent error when saving tag without isHidden attribute

closes flarum/core#289
This commit is contained in:
Toby Zerner 2015-08-31 13:54:28 +09:30
parent b286ff82e0
commit 6db544abb1
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ export default class EditTagModal extends Modal {
this.slug = m.prop(this.tag.slug() || ''); this.slug = m.prop(this.tag.slug() || '');
this.description = m.prop(this.tag.description() || ''); this.description = m.prop(this.tag.description() || '');
this.color = m.prop(this.tag.color() || ''); this.color = m.prop(this.tag.color() || '');
this.isHidden = m.prop(this.tag.isHidden() || ''); this.isHidden = m.prop(this.tag.isHidden() || false);
} }
className() { className() {

View File

@ -56,7 +56,7 @@ class Tag extends Model
$tag->slug = $slug; $tag->slug = $slug;
$tag->description = $description; $tag->description = $description;
$tag->color = $color; $tag->color = $color;
$tag->is_hidden = $isHidden; $tag->is_hidden = (bool) $isHidden;
return $tag; return $tag;
} }