mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 19:36:08 +01:00
Don't change page template if there is no page template field, OR if the template is of type default, or not set
Fixes https://github.com/getgrav/grav-plugin-admin/issues/1059 Fixes https://github.com/getgrav/grav/issues/1403 Fixes https://github.com/getgrav/grav-plugin-admin/issues/1062
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
# v1.3.3
|
||||
## 04/xx/2017
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fix for regression introduced in the automatic page template switch when changing page parent [#1059](https://github.com/getgrav/grav-plugin-admin/issues/1059) [grav#1403](https://github.com/getgrav/grav/issues/1403) [#1062](https://github.com/getgrav/grav-plugin-admin/issues/1062)
|
||||
|
||||
# v1.3.2
|
||||
## 04/10/2017
|
||||
|
||||
|
||||
@@ -1362,7 +1362,8 @@ class AdminController extends AdminBaseController
|
||||
|
||||
$this->admin->json_response = [
|
||||
'status' => 'success',
|
||||
'child_type' => 'default'
|
||||
'child_type' => '',
|
||||
'message' => $this->admin->translate('PLUGIN_ADMIN.NO_CHILD_TYPE')
|
||||
];
|
||||
|
||||
return true;
|
||||
|
||||
@@ -50,12 +50,18 @@ $(document).on('change', '[name="data[route]"]', (event) => {
|
||||
const pageTemplate = $('[name="data[name]"]');
|
||||
const URI = `${config.base_url_relative}/ajax.json/task${config.param_sep}getChildTypes`;
|
||||
|
||||
if (pageTemplate.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
request(URI, {
|
||||
method: 'post',
|
||||
body: { rawroute }
|
||||
}, (response) => {
|
||||
const type = response.child_type || 'default';
|
||||
const type = response.child_type;
|
||||
if (type !== '' && type !== 'default') {
|
||||
pageTemplate.val(type);
|
||||
pageTemplate.data('selectize').setValue(type);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
16
themes/grav/js/admin.min.js
vendored
16
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
53
themes/grav/js/vendor.min.js
vendored
53
themes/grav/js/vendor.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user