-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional logic in Gutenberg block fields no longer working #800
Comments
We have the same issue |
Same issue for me, any news ? |
Still an issue in version v3.1.11. |
After some debugging I found out that the this line cause issues: The property effect for blocks contains an object of name -> value but for metaboxes it is the default one. By using has function we can check the field:
|
Still an issue in v3.1.14 |
@jorostoyanov what is the status? |
Any update on this? |
still an issue in v3.1.20. Eagerly waiting on a fix for this. |
Any update on this? |
Conditional logic in Gutenberg block fields is not working at all, any update on it?? |
Your solution seems to fix this issue. I have committed it to the development branch - ff6ac78 It will be available shortly in the new release! |
Hi @jorostoyanov , I reopen this isssue because conditional logic working :( I have this code : $extend[] = Field::make('select', 'action_type', "Type d'action")
->set_options([
'link_action' => "Lien personnalisé",
'custom_action' => "Action personnalisée"
]);
$extend[] = Field::make('select', 'action_name', 'Action')
->set_options([
'hello' => 'Hello',
'test' => 'Test',
'votirue' => 'Voiture'
])
->set_conditional_logic([
'relation' => 'AND', [
'field' => 'action_type',
'value' => 'custom_action',
'compare' => '=',
]
]);
$extend[] = Field::make('text', 'button_label', "Nom du lien")
->set_conditional_logic([
'relation' => 'AND', [
'field' => 'action_type',
'value' => 'custom_action',
'compare' => '=',
]
]);
$extend[] = Field::make('text', 'button_link', "Lien")
->set_conditional_logic([
'relation' => 'AND', [
'field' => 'action_type',
'value' => 'custom_action',
'compare' => '=',
]
]); The conditionnal logic work for I have a small error in the console :
Carbon field version : https://github.com/htmlburger/carbon-fields/releases/tag/v3.2.1 |
The problem still exists (v3.4.0-beta.1). The logical conditions in Gutenberg don't work. |
Any update on this? |
Same problem here. Logical conditions still don't work in Gutenberg. Did anybody find a solution? Carbon Fields: 3.3.4 |
Also does not work in: |
Still not working on the latest of CF, WP, and PHP :( |
Looks like a broken record, but also not working in: my console throws |
@StudioRATATA did you manage to solve the issue? |
This is still a problem for me many years later. I will look for the bug and make a PR |
I think the conversation on this thread compared to the original issue might be highlighting 2 seperate issues. For anyone having issues with conditional logic in that it says there is an unknown field, ensure that any nested fields can't be matched to the start of any parenting field name. More info here: #1064 (comment) |
If anyone wants to take my findings so far and try and solve the problem, that would be amazing! |
Version
Expected Behavior
Show/hide fields based on other field(s) in the same Gutenberg Block
Actual Behavior
All fields show by default, the conditional logic has no effect
Container definition
Comments
Tested on a fresh WP install. Console errors/warnings screenshot below. I reckon it has something to do with Gutenberg v6 in WP 5.3.
The text was updated successfully, but these errors were encountered: