Skip to content

Commit

Permalink
Fix template picker to avoid errors in certain edge cases (#16400)
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'upstream/pr/16400' into 3.x

* upstream/pr/16400:
  Update modx.window.resource.js
  • Loading branch information
Mark-H committed Feb 10, 2024
2 parents 5162df4 + 6861ed9 commit 8c35dbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions core/docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ development release, and is only shown to give an idea of what's currently in th
- Fix horizontal overflow on Context Access grid (#16380)
- Grid filtering via URL parameters added to most grids in the manager (#16089, #16369)
- Store last opened media browser path in browser history / URL parameters to re-open last path (#16394)
- Fix template picker to avoid errors in certain edge cases (#16400)

MODX Revolution 3.0.3-pl (January 17, 2023)
====================================
Expand Down
23 changes: 11 additions & 12 deletions manager/assets/modext/widgets/resource/modx.window.resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,22 +256,21 @@ Ext.extend(MODx.combo.TemplatePicker, Ext.Panel, {
columns: 1,
items: items,
listeners: {
'render': {
fn: function(tf) {
var value = tf.getValue();

if (value.record) {
this.fireEvent('select', value.record);
render: {
fn: function(cmp) {
const value = cmp.getValue(),
record = value?.record
;
if (record) {
this.fireEvent('select', record);
}
},
scope: this
},
'change': {
fn: function(tf) {
var value = tf.getValue();

if (value.record) {
this.fireEvent('select', value.record);
change: {
fn: function(cmp, checked) {
if (checked.record) {
this.fireEvent('select', checked.record);
}
},
scope: this
Expand Down

0 comments on commit 8c35dbf

Please sign in to comment.