Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
# Summary
Define dependencies between fields based on their states and values.
# Project URL
https://www.drupal.org/project/conditional_fields
# Where is the code?
# Estimated completion date
Unknown
# Dependencies
N/A
# Who's doing the port?
https://www.drupal.org/u/olgarabodzei
https://www.drupal.org/adyax
# What help do they need?
Now we are actively working on the project and we would be glad to get any help (as developing, testing, reviewing).
# D8 roadmap
#2830988: [meta] 4.0.0 release roadmap
# Background and reference information
#2406265: Drupal 8 version Assigned to: OlgaRabodzei
Comments
Comment #2
peterpoe CreditAttribution: peterpoe as a volunteer commentedComment #3
mlncn CreditAttribution: mlncn at Agaric for Teachers with GUTS commentedDifferences with / chance for Unity in Drupal 8 for the https://www.drupal.org/project/field_conditional_state module?
Comment #4
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedI'm about to help to port the module.
Do You have any groundwork?
I would be very pleased if You could share it.
Comment #5
isimgt CreditAttribution: isimgt commentedthis module looks great https://www.drupal.org/project/field_states_ui
Comment #6
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedHi all!
I represent Adyax company. We started porting the module and finished some base work. We used ideas of conditional_fields and field_states_ui modules. And we would like to share our work. A DEV version could be provided by us in a week.
I would be very pleased if maintainers of conditional_fields module contacted me as soon as possible. I'll venture to update this task, this one (https://www.drupal.org/node/2406265) and Kanban board in a case you wouldn't contact me.
Comment #7
ion.macaria CreditAttribution: ion.macaria as a volunteer commentedHello Olga, tell me please what is the progress with that module, and can you give me some code, or can I help you with something?
I have 3 years in drupal development, but I am beginner in drupa 8 (symfony).
I want to begin a project in drupal 8, and this module is vital for him.
Comment #8
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedHello, Ion!
Sorry for a short delay. Here is a link to repository with the work we have done. In the master branch You can find working code, that uses conditional fields module's logic. And the field_states_ui branch contains an attempt to use plugin logic from field_states_ui module. I was inspired to try field_states_ui instead of conditional_fields by comments from the issue. Hope You'll find this code useful!
https://github.com/OlgaRabodzei/conditional_fields
Comment #9
itsekhmistro CreditAttribution: itsekhmistro at Adyax commentedHi Olga,
Could you outline what features are currently working in conditional_fields port for D8 ?
Thank you in advance.
Comment #10
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedFor now code provides:
1) Add/edit/delete conditions operations. All settings are saved in an entity form display configuration.
2) Working conditions are "is filled" and "is empty"
3) Working states are:
- visible
- invisible
- required
- optional
4) Also validation works properly
Comment #11
RKopacz CreditAttribution: RKopacz as a volunteer commentedI just tested the module from the git repo in #8, as I have an immediate use case. After installation, neither the manage form display page nor the manage display tabs resolved when I clicked. I received a "Can't display site" message in Chrome. The following message appeared in Watchdog:
nvalidArgumentException: EntityDisplay entities can only handle fieldable entity types. in Drupal\Core\Entity\EntityDisplayBase->__construct() (line 126 of /var/www/wildlife/core/lib/Drupal/Core/Entity/EntityDisplayBase.php).
Comment #12
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedHello, Robert!
Some bugs were fixed.
I would be very pleased, if You tested the module one more time.
Comment #13
lathanModule tested https://github.com/OlgaRabodzei/conditional_fields
I added the module then I have been trying to add the very first dependency we have. Where the label field on a blog entity type is dependent on a value “Employee Benifits” in a term reference field. It would also not save the value field no matter what I entered.
It does not want to hide the label at any point when I create a new blog post. Even if I say only show the label field if the field is filled…. still no hiding.
On a side note even once you have added a conditional field. "/admin/content/conditional_field" does not list the current fields, you have to re-traverse the relationship tree before you find what you added before.
Best lathan
Comment #14
RKopacz CreditAttribution: RKopacz as a volunteer commentedThanks, @OlgaRabodzei I'll test it shortly.
Comment #15
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedHello everyone!
I kindly ask all not indifferent to join the discussion on Friday!
Let it be at 15:00(CET) on Friday 21/10/2016.
The goal of it is to discuss the future of next three projects that solve one issue and to make one general resolution for it.
The projects are
- https://www.drupal.org/project/conditional_fields
- https://www.drupal.org/project/field_states_ui
- https://github.com/OlgaRabodzei/conditional_fields
You could ping me on the email (orabodzei@adyax.com) for sending an invitation.
Also I'll provide here a link an hour before we'll start.
Comment #16
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedHello!
As I didn't get any response from maintainers, I ventured to create the task https://www.drupal.org/node/2827031
Also I decided to assign to me tasks related to Drupal 8 version of this module.
Comment #17
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedHello!
The dev-version that we made was published on drupal.org
Comment #18
juliencarnot CreditAttribution: juliencarnot at oqp.io commentedHi Olga,
Are you going to create dev release on drupal.org? Might help testers to give it a try.
Should I copy the pending issues from GitHub to here so that we can focus on this queue?
Thanks again!
Comment #19
maxilein CreditAttribution: maxilein commentedPlease, a dev release!
Comment #20
Anonymous (not verified) CreditAttribution: Anonymous commented@Olga, are you sure? The only d8 version I see has been added on 29-9-2015.
Comment #21
juliencarnot CreditAttribution: juliencarnot at oqp.io commented@Vic: there's no dev release yet so you won't see it on the project page, but the latest code has been commited: http://cgit.drupalcode.org/conditional_fields/commit/?id=25c2d427b791dd5...
you can git clone git://git.drupal.org/project/conditional_fields.git and git checkout 8.x-1.x to test it.
Comment #22
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedHi all!
I added dev release, but it's not stable yet.
@Julien, I would be very pleased, if You found time to copy tasks from GitHub.
Comment #23
KevinVb CreditAttribution: KevinVb commentedInstalling the dev version gives:Error: syntax error, unexpected '?' in modules/contrib/conditional_fields/src/Form/ConditionalFieldEditForm.php,
line 190
First testcase:
Also hide/show isn't working for radio buttons. The element is hidden but never shown.
Second testcase:
I wanted to try to show/hide a field when a email field isn't empty. So i used the email value with the setting 'Filled'.
But then I can't save the condition:
Javascript error: An invalid form control with name='field_email[0][value]' is not focusable.
We are looking for a state module for fields. So maybe we will be working on this module.
It depends on the maintenance of this module.
Comment #24
itsekhmistro CreditAttribution: itsekhmistro at Adyax commentedHi Kevin,
Thank you for review but please avoid using this issue for posting bugs. It's a major issue for tracking D8 port status.
I will appreciate if you follow Drupal org approach: First check if there is already a known issue and if not create a new one.
Just in case.
>Installing the dev version gives:Error: syntax error, unexpected '?' in modules/contrib/conditional_fields/src/Form/ConditionalFieldEditForm.php,
line 190
Already fixed.
For other testcases please create an issue if doesn't exist yet.
Regards.
Comment #25
zerolab CreditAttribution: zerolab at Torchbox for The Chartered Society of Physiotherapy commentedComment #26
geek-merlinCrosslinking #2851763: [ddf] Dynamic dependent fields, which has similar and imho non-overlapping use cases.
EDIT: What if we extend StateAPI with an operation like "ajax-reload the target field" and condition "field has changed"?
This would leverage the Framework to obsolete the other module.
Ore are they too different in the end?
(Hmm, as i see, ddf maintainer @maximpodorov also is at adyax...)
Comment #27
shaisamuel CreditAttribution: shaisamuel commentedAny timeline or estimates for first Alpha version?
Comment #28
Rus71Kolosvetov CreditAttribution: Rus71Kolosvetov commentedEntityReference get always node(Node::load), not view on "#target_type" but "#target_type" may be not node, example "taxonomy_term" and module work wrong
Comment #29
mmjvb CreditAttribution: mmjvb as a volunteer commentedSet Status to Needs work because there is only a dev release.
For Needs review it needs a tag for alpha or beta.
When the work is more like an RC, it should be tagged as such and Status set to RTBC.
Comment #30
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedRevert changes.
Comment #31
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #32
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #33
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #34
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #35
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #36
mmjvb CreditAttribution: mmjvb as a volunteer commented@focus13 Please undo your changes. This issue is about conditional_fields, create a new issue for views_exclude_previous, if you need one!
Don't change the title of an issue here, unless it is incorrect.
Comment #37
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #38
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commentedComment #39
focus13 CreditAttribution: focus13 as a volunteer and for Klee Interactive (Klee Group) commented@mmjvb forgive me, i revert all my changes. i hope all things are corrects now ?
Comment #40
mmjvb CreditAttribution: mmjvb as a volunteer commented@focus13 don't worry, we all make mistakes. Noticed that you are still assigned. That lead to checking the differences. Use the View history link at the top, check the issue with my change and compare it with the current one. There shouldn't be any difference.
Saw you created a new issue for views_exclude_previous, thumbs up!
Comment #41
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedComment #42
jhego CreditAttribution: jhego commentedThe module no longer works since the update to the alpha version, please fix that
Comment #43
mmjvb CreditAttribution: mmjvb as a volunteer commented@jhego For support create an issue with the project itself.
Comment #44
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedJulien, please, check alpha2 release. If You have any troubles with the module, please, check this list first and than create an issue.
Comment #45
mmjvb CreditAttribution: mmjvb as a volunteer commentedAdded 8.x-1.0-alpha2 and https://www.drupal.org/u/olgarabodzei
Comment #46
colan@OlgaRabodzei or any other maintainer: I just spent some time sifting through the issue queue reviewing patches and such, setting some RTBC issues to Needs Work and whatnot. There are now 7 RTBCs that look good.
Would you kindly commit these, or if you're too busy, I'd be happy to help with co-maintenance (committing patches and cutting releases) if you'd be willing to grant me maintainer access. Thanks!
Comment #47
colanWill be working on this now that I have access as per #2925603: Offering to co-maintain Conditional Fields. Note that I added the roadmap issue here.
Comment #48
mmjvb CreditAttribution: mmjvb as a volunteer commentedComment #49
colanJust released 8.x-1.0-alpha4. There's still a fair amount of work to do so help would be really appreciated. Take a look at the #2830988: [meta] 4.0.0 release roadmap to see what's left.
Also note the discussion in #2913096: Business Rules module's "Dependent fields" feature: overlap discussion.
Comment #50
Leagnus CreditAttribution: Leagnus commented8.x-1.0-alpha4 doesn't work with commerce-8.x-2.x-dev product types fields.
Comment #51
colan#50: Please open a separate issue for that if there isn't one already. Thanks!
Comment #52
mmjvb CreditAttribution: mmjvb as a volunteer commentedComment #53
dqd(DELETED) Comment here now: https://www.drupal.org/project/conditional_fields/issues/2830988#comment...
Comment #54
colan#53: That place for that discussion is #2830988: [meta] 4.0.0 release roadmap. Please add your comments over there.
Comment #55
dqd#54: Agreed, and I actually know ... *urg* - mixed browser issue tabs here... Sry and Thanks for informing me. https://www.drupal.org/project/conditional_fields/issues/2830988#comment...
Comment #56
geek-merlinI have put quite some work into making this work for D8, but at some point i saw that server side form structure and client side HTML structure are such a mismatch that abstracting JS StateApi like this will take huge amounts of effort to maintain and track changes in widget structure.
I'm currently working on Ajax Dependency which does the dependencies server-side. If someone wants to merge this into conditional_fields (making StateApi and AjaxDependency dependency provider plugins), i am very willing to support, and can help with that.