• Resolved therealgilles

    (@chamois_blanc)


    Hello,

    As at least one other person has reported, I’m having super slow admin custom post updates (30+ seconds) on custom posts not related to Pods. On my site, this happens with the Events Calendar when I try to update an event.

    I’m currently trying to narrow it down with xdebug and qcachegrind but it looks like it is related to Pods and the three following functions:
    1) PodsAPI:handle_changed_fields
    2) PodsAPI->export_pod_item
    3) PodsAPI->export_pod_item_level

    There is no reason for Pods to be running on events update from the Events Calendar, as those are not Pods custom post types.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter therealgilles

    (@chamois_blanc)

    I am not quite understanding why handle_changed_fields is called with for the tribe_events custom post type (which is not part of the Pods CPTs):

    PodsAPI::handle_changed_fields($pod = 'tribe_events', $id = <number>, $mode = 'reset') .../wp-content/plugins/pods/classes/PodsMeta.php

    Thread Starter therealgilles

    (@chamois_blanc)

    In this function, should the first thing to check be whether the post_type is handled by Pods?

    /**
    	 * Track changed fields before save for posts.
    	 *
    	 * @param array $data
    	 * @param array $postarr
    	 *
    	 * @return array
    	 */
    	public function save_post_track_changed_fields( $data, $postarr ) {
    
    		$no_conflict = pods_no_conflict_check( 'post' );
    
    		if ( ! $no_conflict && ! empty( $data['post_type'] ) && ! empty( $postarr['ID'] ) ) {
    			$pod = $data['post_type'];
    			$id  = $postarr['ID'];
    
    			PodsAPI::handle_changed_fields( $pod, $id, 'reset' );
    		}
    
    		return $data;
    
    	}
    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    Our team is looking over this and will let you know as soon as we have determined the best way forward to resolve this.

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    Pods 2.8.18 will address this in a clean way and also offers the new setting under Pods Admin > Settings in which you can now enable/disable tracking changed fields at all. This will be released at some point tomorrow if all goes well.

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    Pods 2.8.18 was released Friday. It includes a new setting under Pods Admin > Settings to control how fields are tracked.

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

The topic ‘Admin issue with Pods and handle_changed_fields’ is closed to new replies.