Skip to content

Commit

Permalink
Fixed image / file migration settings
Browse files Browse the repository at this point in the history
Signed-off-by: Elliot Condon <e@elliotcondon.com>
  • Loading branch information
elliotcondon committed Mar 18, 2014
1 parent ca327f3 commit 7a97a88
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 8 deletions.
8 changes: 8 additions & 0 deletions admin/updates/5.0.0.php
Expand Up @@ -233,6 +233,14 @@ function _migrate_field_500( $field ) {
// image / file settings
if( $field['type'] == 'image' || $field['type'] == 'file' ) {

// save_format is now return_format
if( !empty($field['save_format']) ) {

$field['return_format'] = acf_extract_var( $field, 'save_format' );

}


// object is now array
if( $field['return_format'] == 'object' ) {

Expand Down
28 changes: 20 additions & 8 deletions config.codekit
Expand Up @@ -18,14 +18,6 @@
"outputAbbreviatedPath": "No Output Path",
"outputPathIsSetByUser": 0
},
"\/admin\/field-group.php": {
"fileType": 8192,
"ignore": 0,
"ignoreWasSetByUser": 0,
"inputAbbreviatedPath": "\/admin\/field-group.php",
"outputAbbreviatedPath": "No Output Path",
"outputPathIsSetByUser": 0
},
"\/admin\/field-groups.php": {
"fileType": 8192,
"ignore": 0,
Expand Down Expand Up @@ -1151,6 +1143,26 @@
"outputPathIsSetByUser": 0,
"processed": 0
},
"\/js\/field-group.js": {
"fileType": 64,
"ignore": 0,
"ignoreWasSetByUser": 0,
"inputAbbreviatedPath": "\/js\/field-group.js",
"outputAbbreviatedPath": "\/js\/field-group.min.js",
"outputPathIsSetByUser": 0,
"outputStyle": 1,
"syntaxCheckerStyle": 0
},
"\/js\/field-group.min.js": {
"fileType": 64,
"ignore": 1,
"ignoreWasSetByUser": 0,
"inputAbbreviatedPath": "\/js\/field-group.min.js",
"outputAbbreviatedPath": "\/js\/field-group.min.min.js",
"outputPathIsSetByUser": 0,
"outputStyle": 1,
"syntaxCheckerStyle": 1
},
"\/js\/input.js": {
"fileType": 64,
"ignore": 1,
Expand Down
7 changes: 7 additions & 0 deletions fields/file.php
Expand Up @@ -56,6 +56,13 @@ function __construct() {
function load_field( $field ) {

// v4 to v5 compatibility
if( !empty($field['save_format']) ) {

$field['return_format'] = acf_extract_var( $field, 'save_format' );

}


if( $field['return_format'] == 'object' ) {

$field['return_format'] = 'array';
Expand Down
7 changes: 7 additions & 0 deletions fields/image.php
Expand Up @@ -57,6 +57,13 @@ function __construct() {
function load_field( $field ) {

// v4 to v5 compatibility
if( !empty($field['save_format']) ) {

$field['return_format'] = acf_extract_var( $field, 'save_format' );

}


if( $field['return_format'] == 'object' ) {

$field['return_format'] = 'array';
Expand Down

0 comments on commit 7a97a88

Please sign in to comment.