Title: Bug? PHP AutoSync
Last modified: March 8, 2024

---

# Bug? PHP AutoSync

 *  Resolved [epickau](https://wordpress.org/support/users/epickau/)
 * (@epickau)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/bug-420/)
 * Hi,
   when I change the php auto sync path, the deleting doesn’t work properly.
   After adding the filter to the “delete_field_group” function it worked seamless.
 * Is this a bug or am I doing something wrong?
 *     ```wp-block-code
       function delete_field_group($field_group){
   
               // bail early
               if(!$this->is_php_enabled()){
                   return;
               }
   
               // bail early
               if(!acfe_has_php_sync($field_group)){
                   return;
               }
   
       	// vars
               $id = $field_group['ID'];
               $key = $field_group['key'];
               $path = untrailingslashit(acf_get_setting('acfe/php_save'));
   
       	// backup path
               $new_path = $path;
   
               // filters
               $new_path = apply_filters("acfe/settings/php_save/all",        $new_path, $field_group);
               $new_path = apply_filters("acfe/settings/php_save/ID={$id}",   $new_path, $field_group);
               $new_path = apply_filters("acfe/settings/php_save/key={$key}", $new_path, $field_group);
   
               $diff = $path !== $new_path;
   
               // custom path
               if($diff){
                   acf_update_setting('acfe/php_save', $new_path);
               }
   
       		// wp appends '__trashed' to end of 'key' (post_name)
               $key = str_replace('__trashed', '', $field_group['key']);
   
               // delete file
               $this->delete_file($key);
   
       	// restore
               if($diff){
                   acf_update_setting('acfe/php_save', $path);
               }
           }
       ```
   
    -  This topic was modified 2 years, 3 months ago by [epickau](https://wordpress.org/support/users/epickau/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/bug-420/#post-17727082)
 * Hello,
 * Thanks for the feedback, and sorry for the late answer.
 * I’m not sure to fully understand the issue. Do you mean that PHP files generated
   by ACFE in the `/acfe-php/` folder aren’t correctly deleted when a Field Group
   is deleted from the ACF UI?
 * This is not normal and shouldn’t happen. Are you sure that you don’t have some
   specific folder/files permissions on the `/acfe-php/` folder? Can you try this
   feature on a different environment, for example a local environment? It might
   be a server-side issue.
 * Please let me know if you managed to find something.
 * Thanks.
 * Regards.
 *  Thread Starter [epickau](https://wordpress.org/support/users/epickau/)
 * (@epickau)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/bug-420/#post-17729247)
 * Hey,
   when I change the default path (`/acfe-php/`) via `acfe/settings/php_save`
   filter, they get not deleted via acf ui.
 * The `delete_field_group` function dont have the filter like the `update_field_group`
   function.
 * Thanks.
 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/bug-420/#post-17735012)
 * Hello,
 * Thanks for the details!
 * In fact, I was able to reproduce the issue, you’ve described. I’ve included the
   fix in the next patch.
 * I’ll let you know once it’s released.
 * Sorry for the inconvenience.
 * Regards.
 *  Thread Starter [epickau](https://wordpress.org/support/users/epickau/)
 * (@epickau)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/bug-420/#post-17736341)
 * I’m glad I could help 🙂
 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/bug-420/#post-17737468)
 * Hello,
 * Just a heads up to let you know the latest 0.9.0.3 version fixed this issue.
 * Thanks again for the report.
 * Have a nice day!
 * Regards.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Bug? PHP AutoSync’ is closed to new replies.

 * ![](https://ps.w.org/acf-extended/assets/icon-256x256.png?rev=2071550)
 * [Advanced Custom Fields: Extended](https://wordpress.org/plugins/acf-extended/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-extended/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-extended/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-extended/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-extended/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-extended/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/bug-420/#post-17737468)
 * Status: resolved