Home Forums General Issues Relationship Field Not Saving


Relationship Field Not Saving

  • I have read other issues on this and unfortunately no solution has worked.

    I have a relationship field on a CPT that relates to another CPT and the value is not saving. I have done this both locally and on the staging site with no issues, but when I pushed it to production this field is not working. I’ll also note that I added another basic select field at the same time that is having no issues saving.

    I have already tried the max_input_vars and confirmed that it is being changed via phpinfo() but it’s still not saving. I’ve also tested deactivating all other plugins and re-creating the relationship field with a different name but neither have worked.

    I’m using the latest version of WP and ACF Pro:
    Wordpress 4.8.1
    Advanced Custom Fields PRO 5.6.1

  • i have the same problem!
    We understand that the problem came with version 5.6.1
    We also tried to go back to the old version but the problem persists, and if we create a test server with old version and old db everything works correctly.

    It also not only does not save the field but can not enter a field group that contains the RELATIONSHIP field otherwise the browser stops responding

  • I ended up switching the field type to Post Object and was able to save without any issues. From what I found in the documentation, the Relationship field is just a stylized version of the Post Object field.

    Still, it’s not exactly a “fix” if you specifically want to use the Relationship field.

  • I don’t have a solution because I have not experienced the problem, but I do have some questions.

    What version of PHP is running on the servers where the relationship is not saving?

    Do you have an issue with other field types that save serialized data, for example multis select, taxonomy or user fields?

  • I am having the same issue. Serialized data saves fine. As far as I can tell the issue I detect is that get_field(‘relationship_field’) is retrieving the “post_id” instead of the “meta_value” from the database

    Attached is a screenshot of my database (with relationship field filtered) / php file (with get_field & vardump of field) / webpage with output
    screenshot of database, php file and output

  • Are you saying that you should be getting an array of post objects and that you’re getting an array of post IDs?

    If this is the case, the most common cause of ACF returning ID values rather that posts, attachments, and other objects is a pre_get_post filter that is filtering queries that it shouldn’t be.

    Deactivate other plugins, switch themes and see if you can narrow down the cause. I can tell you that I am not experiencing this on any of the sites I maintain and I’m not having this issue on my current project.

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

The topic ‘Relationship Field Not Saving’ is closed to new replies.