vinkla / extended-acf

Register advanced custom fields with object-oriented PHP
MIT License
455 stars 61 forks source link

Taxonomy field save_terms #98

Closed LudovicFauchet closed 3 years ago

LudovicFauchet commented 3 years ago

Hello,

I have to taxonomy fields on a page :

  1. One with the save_terms with true value
  2. The second with the save_terms with false value.

But when i save my page the second terms with the save_terms with the false value attach his terms to the posts, so he shouldn't.

Cheers

vinkla commented 3 years ago

If you're using this package, provide the code which isn't working for you. Otherwise, please use the ACF forum instead.

LudovicFauchet commented 3 years ago

Hello,

I'm using this package sure.

This part of code is working wrong :

\WordPlate\Acf\Fields\Taxonomy::make('Menu de la page', 'archive_menu')
            ->taxonomy('category', 'disciplines_sports', 'localisations')
            ->appearance('multi_select')
            ->createTerms(false)
            ->loadTerms(false)
            ->saveTerms(false)
            ->returnFormat('object')

This field is saving is attaching this term to the post, so saveTerms is set to false...

vinkla commented 3 years ago

Can you reproduce this issue using the field editor in the ACF dashboard?

LudovicFauchet commented 3 years ago

@vinkla Hello !

I tried to use the default field editor in the ACF dashboard and i don't have this bug.

Cheers

vinkla commented 3 years ago

Okay, good. What do you think is the issue here?

LudovicFauchet commented 3 years ago

I don't understand what do you mean.

vinkla commented 3 years ago

I haven't used these methods much and I'm not sure why this isn't working. Have you tried to dribble with the source code to try to find out what it is that isn't working?

vinkla commented 3 years ago

It seems these methods are false by default so you could probably just leave them out.