• Resolved epickau

    (@epickau)


    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?

    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 8 months, 2 weeks ago by epickau.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    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

    (@epickau)

    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

    (@hwk-fr)

    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

    (@epickau)

    I’m glad I could help ??

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    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.