Skip to content

Commit

Permalink
Merge branch 'release/1.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Jan 5, 2023
2 parents 66b3191 + eec3c05 commit 04ec3cc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v1.3.3
## 01/04/2023

1. [](#improved)
* Save `post-save` action to session
* Set default `post-save` action to `edit` for create and edit

# v1.3.2
## 12/02/2022

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% set originalValue = value %}
{% set value = (value is null ? field.default : value) %}
{% set isNew = key ? false : true %}
{% set savedOption = grav.session.post_entries_save|default('create-new') %}
{% set savedOption = grav.session.post_entries_save|default('edit') %}

{% if isNew %}
{% set options = {'create-new':'PLUGIN_FLEX_OBJECTS.ACTION.CREATE_NEW', 'edit':'PLUGIN_FLEX_OBJECTS.ACTION.EDIT_ITEM', 'list':'PLUGIN_FLEX_OBJECTS.ACTION.LIST_ITEMS'} %}
Expand All @@ -12,7 +12,6 @@
{% endif %}

{% block input %}
{% set savedOption = not isNew and savedOption == 'create-new' ? 'edit' : savedOption %}
{% for key, text in options %}
{% set id = field.id|default(field.name) ~ '-' ~ key %}

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Flex Objects
slug: flex-objects
type: plugin
version: 1.3.2
version: 1.3.3
description: Flex Objects plugin allows you to manage Flex Objects in Grav Admin.
icon: list-alt
author:
Expand Down
1 change: 1 addition & 0 deletions classes/Admin/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ public function taskSave(): void
// Set route to point to the current page.
if (!$this->redirect) {
$postAction = $request->getParsedBody()['_post_entries_save'] ?? 'edit';
$this->grav['session']->post_entries_save = $postAction;
if ($postAction === 'create-new') {
// Create another.
$route = $this->referrerRoute->withGravParam('action', null)->withGravParam('', 'add');
Expand Down

0 comments on commit 04ec3cc

Please sign in to comment.