Skip to content

Commit

Permalink
Fixed tags not being saved on new pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ssddanbrown committed May 15, 2016
1 parent db2af47 commit 77a9657
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ language: php
php:
- 7.0

node_js:
- "4.1.2"
env:
- NODE_JS_VERSION=5

cache:
directories:
Expand All @@ -15,6 +15,9 @@ addons:

before_install:
- npm install -g npm@latest
- curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/v0.31.0/nvm.sh # update nvm
- bash -c "nvm use $NODE_JS_VERSION" || true
- bash -c "source ~/.nvm/nvm.sh; nvm install $NODE_JS_VERSION; node --version"

before_script:
- mysql -e 'create database `bookstack-test`;'
Expand Down
5 changes: 5 additions & 0 deletions app/Repos/PageRepo.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ public function publishDraft(Page $draftPage, array $input)
{
$draftPage->fill($input);

// Save page tags if present
if(isset($input['tags'])) {
$this->tagRepo->saveTagsToEntity($draftPage, $input['tags']);
}

$draftPage->slug = $this->findSuitableSlug($draftPage->name, $draftPage->book->id);
$draftPage->html = $this->formatHtml($input['html']);
$draftPage->text = strip_tags($draftPage->html);
Expand Down

0 comments on commit 77a9657

Please sign in to comment.