• It looks like in 1.2 you introduced a breaking change to the name of the fields.

    In 1.1.7 the field name was “simple_value_formated”

    In 1.2.0 the field name is “simple_value_formatted”

    The same t vs tt change was done in other fields.

    This change broke some of our code and took quite some time to figure out why the field name had changed.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Phi Phan

    (@mr2p)

    Hi @codewisenicolas, Yes, I have changed the word formatted for all fields. To fix it, you can use a simple code snippet like this:

    // Make sure this hook run first by set the priority as 1.
    add_filter( 'meta_field_block_acf_field_format_value_for_rest', function ($rest_formatted_value) {
      $rest_formatted_value['simple_value_formated'] = $rest_formatted_value['simple_value_formatted'];
      $rest_formatted_value['value_formated'] = $rest_formatted_value['value_formatted'];
    
      return $rest_formatted_value;
    }, 1);
    Thread Starter codewisenicolas

    (@codewisenicolas)

    Thank you for the code, however please be aware that a breaking change is a big deal. Plugins update automatically in some installations, this change can surprise many users that are not technical and don’t know what happened or how to fix it. Its not even listed in your changelog (only that the code was refactored)

    Normally breaking changes should happen with a much bigger notice and usually reserved for major version changes. If possible, include a deprecation fix so that websites dont break with the update and people have time to migrate to the new way.
    For example, by including your code fix into your plugin would prevent sites from breaking but give people time to update their code.

    I would suggest putting out a 1.7.1 that includes your temp fix to prevent sites from breaking, and a much bigger notice in the changelog or plugin info so people are aware that in a later version this will change.

    Thank you for the plugin and your work. I appreciate it and hope that you continue improving it.

    Plugin Author Phi Phan

    (@mr2p)

    Thank you very much for your feedback and your appreciation. I did not expect someone would extend this block in that way, that’s why I though that change will not effect custom code. I’ll add bigger notices and deprecation code in future version.

    Thank you again for your feedback.

    Thread Starter codewisenicolas

    (@codewisenicolas)

    We have some front end code that pulls in post data via ajax from a content type that has ACF fields. Specifically the rest v2 json functionality that’s part of WP and extended by ACF.

    The front end code was designed for ‘simple_value_formated’. As you can imagine, once that field name changed it stopped the front end from being able to load the content of the post.

    Plugin Author Phi Phan

    (@mr2p)

    Yes, I see what you mean. You can extract my code above to a tiny plugin and install it on your sites as a hot fix for now. I’ll do my best for next releases.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘BREAKING CHANGE’ is closed to new replies.