File tree Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -858,7 +858,7 @@ Shortcode = Backbone.Model.extend({
858
858
this . get ( 'attrs' ) . each ( function ( attr ) {
859
859
860
860
// Skip empty attributes.
861
- if ( ! attr . get ( 'value' ) || attr . get ( 'value' ) . length < 1 ) {
861
+ if ( ! attr . get ( 'value' ) || attr . get ( 'value' ) . length < 1 ) {
862
862
return ;
863
863
}
864
864
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ Shortcode = Backbone.Model.extend({
280
280
this . get ( 'attrs' ) . each ( function ( attr ) {
281
281
282
282
// Skip empty attributes.
283
- if ( ! attr . get ( 'value' ) || attr . get ( 'value' ) . length < 1 ) {
283
+ if ( ! attr . get ( 'value' ) || attr . get ( 'value' ) . length < 1 ) {
284
284
return ;
285
285
}
286
286
@@ -1754,6 +1754,11 @@ sui.views.editAttributeSelect2Field = sui.views.editAttributeField.extend( {
1754
1754
inputChanged : function ( e ) {
1755
1755
var _selected = $ ( e . currentTarget ) . val ( ) ;
1756
1756
1757
+ // Empty fields will have null values. We don't want to coerce that to the string "null".
1758
+ if ( _selected === null ) {
1759
+ _selected = '' ;
1760
+ }
1761
+
1757
1762
// Store multiple selections as comma-delimited list
1758
1763
if ( Array . isArray ( _selected ) ) {
1759
1764
_selected = _selected . join ( ',' ) ;
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ Shortcode = Backbone.Model.extend({
69
69
this . get ( 'attrs' ) . each ( function ( attr ) {
70
70
71
71
// Skip empty attributes.
72
- if ( ! attr . get ( 'value' ) || attr . get ( 'value' ) . length < 1 ) {
72
+ if ( ! attr . get ( 'value' ) || attr . get ( 'value' ) . length < 1 ) {
73
73
return ;
74
74
}
75
75
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ sui.views.editAttributeSelect2Field = sui.views.editAttributeField.extend( {
20
20
inputChanged : function ( e ) {
21
21
var _selected = $ ( e . currentTarget ) . val ( ) ;
22
22
23
+ // Empty fields will have null values. We don't want to coerce that to the string "null".
24
+ if ( _selected === null ) {
25
+ _selected = '' ;
26
+ }
27
+
23
28
// Store multiple selections as comma-delimited list
24
29
if ( Array . isArray ( _selected ) ) {
25
30
_selected = _selected . join ( ',' ) ;
You can’t perform that action at this time.
0 commit comments