Support

Account

Forum Replies Created

  • Weirdly enough, one of the changes in the last (5.0.6, I just noticed there was a newer one) ACF patch seems to have fixed the problem.

    Huzzah for accidental fixes? 😀

  • Is there anything I can do to help move this along? 🙂

  • From the devs over at Relevanssi:

    For some reason, the query seems like a search so that Relevanssi catches it, and since it’s not a search, it’s missing critical parameters and Relevanssi is complaining.

    Can you make that AJAX request look less like a search? Can you show me the code?

  • I definitely can, but I’m not entirely sure what to contact them with in regards to what problem needs to be solved on their end. Are the fields something that don’t need to be defined and Relevanssi is simply not checking if they exist or not? Etc. 🙂

  • Ahhah! When I turned on debug mode I got back an error in the AJAX for ACF regarding Relevanssi. Here’s the related errors (I believe I have them all, but reading xdebug in the response field is a pain).

    Notice: Undefined index: post_type in /media/sf_web/wp0/wp-content/plugins/relevanssi/lib/search.php
    
    Notice: Undefined index: s in /wp-content/plugins/relevanssi/lib/search.php
    
    Notice: Undefined index: posts_per_page in /wp-content/plugins/relevanssi/lib/search.php
    
    Notice: Undefined index: paged in /wp-content/plugins/relevanssi/lib/search.php

    If I disable Relevanssi, the relationship fields are working as expected, but I rather need Relevanssi to uh, search through all these lovely custom fields I’m making, and it’s currently working just fine with both of them enabled with the last version of ACF. 🙁

  • Hm, it looks like neither of the joins are sending along the post_type, which I imagine is probably part of the problem…

    action:acf/fields/relationship/query
    field_key:field_535ad94b471e0
    nonce:9f1a98d75f
    post_id:7332
    max:
    s:
    post_type:
    taxonomy:
    action:acf/fields/relationship/query
    field_key:field_53c982bbe7eab
    nonce:9f1a98d75f
    post_id:7332
    max:
    s:
    post_type:
    taxonomy:

    And neither is getting any response back.

  • Any feedback as to what might be going wrong here?

  • Surely! Yes, I meant left – sorry! That’s what happens when I answer right before bed.

    No Matches Found

    Search showing Results

    And here’s the export code for both of the relationships shown above.

    if( function_exists('register_field_group') ):
    
    register_field_group(array (
    	'key' => 'group_53c93c1a57b90',
    	'title' => 'Bios Join',
    	'fields' => array (
    		array (
    			'key' => 'field_535ad94b471e0',
    			'label' => 'Bios',
    			'name' => 'bios',
    			'prefix' => '',
    			'type' => 'relationship',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'post_type' => array (
    				0 => 'team_bio',
    			),
    			'taxonomy' => '',
    			'filters' => array (
    				0 => 'search',
    			),
    			'elements' => '',
    			'max' => '',
    			'return_format' => 'object',
    		),
    	),
    	'location' => array (
    		array (
    			array (
    				'param' => 'post_type',
    				'operator' => '==',
    				'value' => 'page',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'normal',
    	'style' => 'seamless',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => '',
    ));
    
    register_field_group(array (
    	'key' => 'group_53c982b23a920',
    	'title' => 'Page Blocks Join',
    	'fields' => array (
    		array (
    			'key' => 'field_53c982bbe7eab',
    			'label' => 'Page Blocks',
    			'name' => 'page_blocks',
    			'prefix' => '',
    			'type' => 'relationship',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'post_type' => array (
    				0 => 'pageblock',
    			),
    			'taxonomy' => '',
    			'filters' => array (
    				0 => 'search',
    			),
    			'elements' => '',
    			'max' => '',
    			'return_format' => 'object',
    		),
    	),
    	'location' => array (
    		array (
    			array (
    				'param' => 'post_type',
    				'operator' => '==',
    				'value' => 'page',
    			),
    		),
    		array (
    			array (
    				'param' => 'post_type',
    				'operator' => '==',
    				'value' => 'team_bio',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'normal',
    	'style' => 'seamless',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => '',
    ));
    
    endif;
  • I can reproduce it currently with all my relationship fields in the admin – I have a custom post type called ‘Team Members’ and I am trying to relationship them to a page. When I got to a page, there’s no Team Members listed over on the right side.

    If I set up the relationship to allow for searching, I can find team members that way and add them.

    This is one relationship that had existed previously, and when a new one is created either for these two post types, or with another custom post type and page, the same thing happens.

    I can try to list exact steps and screenshots tomorrow if this is still confusing, but sadly my work computer is not accessible at the moment.

  • Hi Heather –

    How are you returning your image from ACF? When you create an image field you should get the option for return value – it looks like yours is just returning 1, so you probably have it set to Image Object. Try returning the image URL instead?

    Your code seems to have a stray " /> right after your while, which I think is where your image code is supposed to be, right?

  • Hello!

    There are a few different ways to do repeaters with field data as tables – I don’t have an example readily available, but if you post the code you’ve been trying to get to work, I can try and point you in the right direction from there.

  • By having just $news = get_sub_field('news'); every time your while loop loops through the array, you’re overwriting the $news variable, if you do $news .= get_sub_field('news'); you’ll be appending to it instead.

    Sorry if that doesn’t make much sense, I am apparently rotten at explaining things. <.<

  • The ACF Export Screen under the PHP section says:

    Registered field groups will not appear in the list of editable field groups.

    So I think you’ve got it right at the end – The fields are only editable via ACF if you do the XML export & import. (I’m with you though, I’d love to be able to just have it in the functions.php!)

Viewing 14 posts - 1 through 14 (of 14 total)