Support

Account

Forum Replies Created

  • Oke. I just found what the issue was.
    I was using the post.post_content variable from twig.
    Apparently that is not a variable that contains the final content.

    For future reference for people with something like this issue:
    Use the {{post.content}} variable

  • Cool.
    Thank you for the information.

    I thought as much but wanted some confirmation on it.

    Would have been a shame if it was indeed a bug that wasn’t found yet.

    Again thanks for the info.
    Will work on different names.

    Cheers

  • Hey guys,

    Yesterday I had an issue with the way fields are named when grouped or not.
    It might be something that should have been obvious but to me it was a first running into this issue.

    I am currently in a transition stage from the free Advanced Custom Fields to the Pro version.
    And though we are not actively going through all the fields to change them where necessary, we do change them so they are grouped and neatly layed out on the page editor page.

    Now here is the issue.
    I made a field of the type group called “hero
    This group was meant to replace a field set also called “hero

    In the old group I had multiple fields of which I will name 2 below (to make the issue clearer).

    Fieldset: Hero – old
    -> hero_title (type: text)
    -> hero_subtitle (type: text)

    So then I made a new fieldset like this.

    Fieldset: Hero – new
    -> hero (type: group)
    -> title (type: text)
    -> subtitle (type: text)

    Again this is just a part of the full fieldsets but you get the point.

    Now the thing that happend was this.
    When I added the new fieldset, it was added to the top of the fieldset order on the page editor screen.
    When I tried to save the new title and subtitle, they wouldn’t save.
    I tried to debug the php and found that wordpress indeed failed to save the values I entered.

    After much trail and error and a not so good night of sleep…. I was looking in the documentation and the database for the fields in question.
    That’s when I noticed that in the database ACF knows what fields are there and what fieldset and or group they belong to.
    But when it is saved, the field inside the “hero” group is saved as “hero_title” and the same for the subtitle. Which means that it is also saved as “hero_subtitle”

    With this knowlede I tried changing the order of the fieldsets in the page editor screen.
    This worked and now the old fields are overwritten.

    Is this a bug or a thing that was always there and it was just coincidence that I stumbed on this now?

    Cheers.

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