- Also updated html field of pages to not be fillable.
(Since HTML should always go through app id parsing)
Related to #2042
*/
class Page extends BookChild
{
*/
class Page extends BookChild
{
- protected $fillable = ['name', 'html', 'priority', 'markdown'];
+ protected $fillable = ['name', 'priority', 'markdown'];
protected $simpleAttributes = ['name', 'id', 'slug'];
protected $simpleAttributes = ['name', 'id', 'slug'];
$page->template = ($input['template'] === 'true');
}
$page->template = ($input['template'] === 'true');
}
+ $pageContent = new PageContent($page);
+ $pageContent->setNewHTML($input['html']);
$this->baseRepo->update($page, $input);
// Update with new details
$this->baseRepo->update($page, $input);
// Update with new details
- $page->fill($input);
- $pageContent = new PageContent($page);
- $pageContent->setNewHTML($input['html']);
$page->revision_count++;
if (setting('app-editor') !== 'markdown') {
$page->revision_count++;
if (setting('app-editor') !== 'markdown') {
$search->assertSee($expectedShelf->name);
}
}
$search->assertSee($expectedShelf->name);
}
}
+
+ public function test_search_works_on_updated_page_content()
+ {
+ $page = Page::query()->first();
+ $this->asEditor();
+
+ $update = $this->put($page->getUrl(), [
+ 'name' => $page->name,
+ 'html' => '<p>dog pandabearmonster spaghetti</p>',
+ ]);
+
+ $search = $this->asEditor()->get('/search?term=pandabearmonster');
+ $search->assertStatus(200);
+ $search->assertSeeText($page->name);
+ $search->assertSee($page->getUrl());
+ }