Skip to content

Commit

Permalink
Prevent default value to be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienheraud committed Jul 17, 2015
1 parent 137443c commit ee4853a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion plugins/cck_field/upload_file/upload_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public function onCCK_FieldDelete( &$field, $value = '', &$config = array() )
return;
}

if ( $value == '' ) {
$value_json = JCckDev::fromJSON( $value );
if ( $value == '' || isset( $value_json['file_location'] ) && $value_json['file_location'] == '' ) {
return;
}

Expand Down
3 changes: 2 additions & 1 deletion plugins/cck_field/upload_image/upload_image.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public function onCCK_FieldDelete( &$field, $value = '', &$config = array() )
return;
}

if ( $value == '' ) {
$value_json = JCckDev::fromJSON( $value );
if ( $value == '' || isset( $value_json['image_location'] ) && $value_json['image_location'] == '' ) {
return;
}

Expand Down

0 comments on commit ee4853a

Please sign in to comment.