Metabox group and admin-ajax.php

Support MB Group Metabox group and admin-ajax.php

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #7196
    grafikgrafik
    Participant

    I have a page with a fair amount of content using the metabox group plugin (see code below). it seems to hammer admin-ajax with calls on page load. I have all the latest versions, and no other plugins installed. Wondering if you had a work around for this or any ideas what is happening?

    $meta_boxes[] = array(
    	'id'		=> 'page_title',
    	'title'		=> 'Project Page',
    	'pages'		=> array( 'page'),
    	'show'   => array(
    		'relation'    => 'OR',
    		'template'    => array( 'tmpl.projects.php'),
    	
    	),
    	'fields'	=> array(
    			
    			array(
    				'id'     => 'project_item',
    				'type'   => 'group',
    				'clone'  => true,
    				'max_clone' => 99,
    				'sort_clone' => true,
    				'collapsible' => true,
    				'group_title' => 'Project',
    				'fields' => array(
    					array(
    						'name'    => __( 'Link', 'rwmb' ),
    						'id'      => "{$prefix}project_link",
    						'type'    => 'post',
    						'clone'    => false,			
    				     	'force_delete' => true,
    				        'std'   => '',
    						'post_type' => 'post',
    						'field_type' => 'select_advanced',
    						'query_args' => array(
    							'post_status' => 'publish',
    							'posts_per_page' => '-1',
    						)
    					),
    
    					array(
    						'name' => __( 'Image', 'rwmb' ),
    						'id'               => "{$prefix}project_image_teaser_full",
    						'type'             => 'image_advanced',
    						'max_file_uploads' => 1,
    						'clone'		=> false,
    
    					),
    					array(
    						'name' => __( 'Portrait Image', 'rwmb' ),
    						'id'               => "{$prefix}project_image_teaser_portrait",
    						'type'             => 'image_advanced',
    						'max_file_uploads' => 1,
    						'clone'		=> false,
    
    					),
    					
    					array(
    						'name' => __( 'Heading', 'rwmb' ),
    						'desc' => __( '', 'rwmb' ),
    						'id'   => "{$prefix}project_name",
    						'type' => 'textarea',
    						'cols' => 10,
    						'rows' => 4,
    					),
    					
    					
    
    					
    				),
    			),
    
    	)
    );
    #7214
    Anh TranAnh Tran
    Keymaster

    Hi, sorry for the delay.

    The group extension doesn't do anything with Ajax. Can you send me a screenshot of Network tab in the console log?

    #7222
    grafikgrafik
    Participant

    Here you go console log http://grfk.co.nz/J3FaQS

    Error: http://grfk.co.nz/3Jnxmb

    #7225
    Anh TranAnh Tran
    Keymaster

    Looks like the ajax request comes from the image advanced field. I've just tested your code again and didn't see any problem. Can you please:

    - Test with a single image advanced field?
    - Probably check what does the server response?
    - Check with other PHP code that might causes 505 error?

    #7229
    grafikgrafik
    Participant

    Thanks for the reply,

    — Do you mean just a single instance of the group, or a single image field inside each group instance (as opposed to two images)?

    #7230
    Anh TranAnh Tran
    Keymaster

    The JS that sends ajax request is in the image advanced field. It queries to get image info from image ID. So, please try with just a single image advanced field. It's not needed to put it inside a group.

    #7238
    grafikgrafik
    Participant

    No admin-ajax error on just one image advanced field

    I went and created some more tests, metabox group does seems to behave very oddly (starts cloning items at certain times) , and maybe this is linked to the above error?

    see video http://grfk.co.nz/kVG2Pk

    $meta_boxes[] = array(
    	'id'		=> 'testing_group',
    	'title'		=> 'Testing Group (ignore)',
    	'pages'		=> array( 'page'),
    	'fields'	=> array(
    			
    			array(
    				'id'     => 'test_item_test',
    				'type'   => 'group',
    				'clone'  => true,
    				'max_clone' => 99,
    				'sort_clone' => true,
    				'collapsible' => true,
    				'group_title' => 'Project',
    				'fields' => array(
    
    					array(
    						'name' => __( 'Image', 'rwmb' ),
    						'id'               => "{$prefix}testing_image_test",
    						'type'             => 'image_advanced',
    						'max_file_uploads' => 1,
    						'clone'		=> false,
    
    					),
    					
    
    					
    				),
    			),
    
    	)
    );

    Metabox 4.12.4
    Metabox Group 1.2.11
    Metabox conditional 1.5
    Metabox show hide 1.02
    Wordpress 4.8.3

    #7253
    grafikgrafik
    Participant

    Hey any update on this?

    #7264
    Anh TranAnh Tran
    Keymaster

    Hi,

    I replicated the bug and am working on it. Will update the plugins as soon as I find something. Please wait a little.

    By the way, does the ajax issue still happen to you? I see no errors in the video.

    #7275
    grafikgrafik
    Participant

    Hi, no unfortunately it still:

    1. Fails to attach images to the back and front end on update
    2. And displays the admin-ajax error

    Video here: http://grfk.co.nz/fHHzEU

    #7276
    Anh TranAnh Tran
    Keymaster

    Can you send me an admin account to check on your website? Please send via the Contact page.

    #7288
    grafikgrafik
    Participant

    Thanks have sent

    #7294
    Anh TranAnh Tran
    Keymaster

    I've received it. Will check it soon.

    #7312
    Anh TranAnh Tran
    Keymaster

    I've just fixed issue of not clearing image_advanced value when cloning a group. Can you please try it on your site to see if it works? I'll release new version when we confirm that.

    #7338
    grafikgrafik
    Participant

    Nice job, that looks like it fixes the issue of cloning

    Still getting the glitchy behaviour of admin-ajax errors and images detaching on the back / front end if I clone a group more than 16 times.

Viewing 15 posts - 1 through 15 (of 22 total)
  • The topic ‘Metabox group and admin-ajax.php’ is closed to new replies.