Support

Account

Home Forums ACF PRO have to re-publish post after a commit

Solved

have to re-publish post after a commit

  • Hi Elliot,

    after I (git) commit my theme with the php acf export in it, acf values are disappearing from the front (they stay visible in the back office)

    I have to go thrue the posts, and publish them again, in order to see the custom fields values in the front…

    Any idea how to fix that ?

    Best

  • Hi @moabi

    You say that the fields and values still exist in admin while not appearing in your theme. Could you do a check right after you encounter this to see wether the values actually exist in the wp_postmeta table for the posts affected.

  • apparently yes they’re still in the wp_postmeta table with the good post ID,
    when I re-publish the post, you can see in the database that the missing values are added (the new values I added to the flexible field)
    So maybe the field won’t be printed until all values are defined ? since i’ve added new values and I didn’t defined them in the back-office (they are not mandatory though…)
    Thank you for your help

  • this still happens,
    I have to republish the post, and everything is ok, but I’m afraid if I have more then 20 or 100 post, I won’t be really enjoying to re-publish everything ! and for production, this is not very nice 🙂
    do you have any idea how to fix this or am I doing something wrong here, did you reproduce the bug ?
    Best

  • Hi @moabi

    I’m not 100% I am completely understanding what you’re experiencing.

    So you have a flexible field in which you’ve added new fields and those are not saving their values on the prod site when all fields are loaded through PHP?

  • Hi,
    workflow :
    => dev : localhost – acf fields stored in php file
    => Prod : http url – updated with git, same configuration

    Process :
    => I add acf fields to a group of field which are assigned to pages (flexible or not)
    => I update the php file with acf fields to do so
    => I commit to Production

    Result :
    some acf fields appears to be missing, like there is no value inside
    But in the database, there are all values (except the new one I just added)

    After result :
    >> I update my page (without touching anything or filling the new acf fields)
    >> The database updates and add the new acf values in wp_postmeta table (and only the new ones)
    >> on page reload, the page is like before with all the fields

    Hope it’s clear enough, I can help in any way, please let me know,

    Best

  • Apparently,
    my mistake was to DUPLICATE fields :
    as i had to quite similar group of fields, I duplicated them, therefore, name was the same but not the key,
    it explains why I could see them in the Back Office but not in the Front…

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

The topic ‘have to re-publish post after a commit’ is closed to new replies.