Skip to content

Commit

Permalink
Improve the Content module
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyCyborg committed Jan 5, 2020
1 parent beade01 commit fa71de5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/Platform/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Define The Application Version
//--------------------------------------------------------------------------

define('VERSION', '1.1.13');
define('VERSION', '1.1.14');

//--------------------------------------------------------------------------
// Set PHP Error Reporting Options
Expand Down
32 changes: 17 additions & 15 deletions modules/Content/Controllers/Admin/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,25 +264,12 @@ public function update(Request $request, $id)
// Create a new Revision from the current Post instance.

if (! $creating) {
$this->createRevision($post, $authUser);
$this->createPostRevision($post, $authUser);
}

//
// Update the current Post instance.

$post->title = $title = Arr::get($input, 'title');

$post->content = Arr::get($input, 'content');

if (empty($slug = Arr::get($input, 'slug'))) {
$slug = Post::uniqueName($title, $post->id);
}

$post->name = $slug;

$post->guid = site_url($slug);

// The Status.
$status = Arr::get($input, 'status', 'draft');

if ($creating && ($status === 'draft')) {
Expand All @@ -308,6 +295,21 @@ public function update(Request $request, $id)
$post->status = $status;
$post->password = $password;

$post->content = Arr::get($input, 'content');

$post->title = $title = Arr::get($input, 'title');

if (empty($slug = Arr::get($input, 'slug'))) {
$slug = Post::uniqueName($title, $post->id);
}

$post->name = $slug;

$post->guid = site_url($slug);

//
// Update the Post custom attributes.

if ($type == 'page') {
$post->parent_id = (int) Arr::get($input, 'parent', 0);
$post->menu_order = (int) Arr::get($input, 'order', 0);
Expand Down Expand Up @@ -399,7 +401,7 @@ public function update(Request $request, $id)
), 200);
}

protected function createRevision(Post $post, User $user)
protected function createPostRevision(Post $post, User $user)
{
$version = 0;

Expand Down

0 comments on commit fa71de5

Please sign in to comment.