Coder Social home page Coder Social logo

Comments (9)

socialblogsite avatar socialblogsite commented on June 25, 2024

Same here. The only field imported appears as #2 in the sort order, and any new field you create takes the #1, since the javascript in the browser didn't get any field #1.

Trying it on newer versions of ACF don't even import a thing.

What version of ACF was this created for?

from acf-php-recovery.

seamusleahy avatar seamusleahy commented on June 25, 2024

This was created for ACF 3. I haven't tested with ACF 4 yet, I'll try to figure it out next week.

from acf-php-recovery.

dotKev avatar dotKev commented on June 25, 2024

This little patch fixes fields import for ACF 4. It still doesn't properly import locations or options, but it's a start.

diff --git wp-content/plugins/ACF-PHP-Recovery-master/acf-php-recovery.php wp-content/plugins/ACF-PHP-Recovery-master/acf-php-recovery.php
index 6a594157d7a761bf9ee2e853050be82411efc6e9..3e80032431e96aed9130798b9c9793e5ac312f97 100644
--- wp-content/plugins/ACF-PHP-Recovery-master/acf-php-recovery.php
+++ wp-content/plugins/ACF-PHP-Recovery-master/acf-php-recovery.php
@@ -43,7 +43,13 @@ function acf_php_recovery_page() {
         }

         // Fields
+        $order_no = 0;
         foreach($fieldset['fields'] as $field) {
+          if(isset($field['order_no'])) :
+            $order_no = max($order_no,$field['order_no']);
+          else:
+            $field['order_no'] = $order_no++;
+          endif;
           add_post_meta( $post_id, $field['key'], $field, true);
         }

from acf-php-recovery.

garrettboatman avatar garrettboatman commented on June 25, 2024

@dmh-kevin, just FYI, I'm not getting any change of behavior with the patch.

from acf-php-recovery.

dotKev avatar dotKev commented on June 25, 2024

Before the patch, I was getting the same issue you described. My php field definitions were old, so perhaps an old ACF export didn't provide all of the fields that newer exports have. I'll test more. I only tested against the content on a project where I really did loose the xml dump and database definitions and was able to retrieve all of my fields.

from acf-php-recovery.

alekstrust avatar alekstrust commented on June 25, 2024

Please update to work with version 4

from acf-php-recovery.

iamntz avatar iamntz commented on June 25, 2024

@alekstrust for ACF4 you could use my little script: https://github.com/iamntz/acf-recovery

Although it doesn't have any option as ACF Recovery does, it will restore all of your fileds ;)

Enjoy!

from acf-php-recovery.

seamusleahy avatar seamusleahy commented on June 25, 2024

Thanks to iamntz and dmh-kevin. It is now updated. There is an issue when attempting to edit a recovered fieldset while the PHP defined version is still active.

from acf-php-recovery.

garrettboatman avatar garrettboatman commented on June 25, 2024

You guys rock.

from acf-php-recovery.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.