Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Select or other currently uses custom javascript to show/hide the 'other' field. Core's form states API should be able to handle this.
A rudimentary, but incomplete patch has already been submitted in https://www.drupal.org/node/2481127#comment-9909759. Let's finish the work we started.
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedThere is a comment in the related issue about using the workaround from comment #4 of #1149078: States API doesn't work with multiple select fields. I am pretty sure this would be a bad idea because it may well conflict with core if/when it ever gets fixed in core. I think that code would be fine in a custom module, but it seems risky for a contrib module.
Comment #2
legolasboI was thinking something like adding the workaround with a warning and a setting to enable/disable it if need be. That way any conflicts with core or contrib code exists, it can be disabled at the risk of broken multi-select boxes.
Fixing the underlaying core issue would be better tho.
Comment #3
DanChadwick CreditAttribution: DanChadwick commentedYour module, but that's a lot of risk when you have a 100% functioning solution now.
There seems to be a little activity in the core issue. If we test it, maybe it will get committed. You can then put a version dependency on core into your .info file. I think it is safe to depend upon a version when it is core.
Comment #4
legolasboPerhaps we can work together on landing the core issue and then fix this issue?
Comment #5
daften CreditAttribution: daften at Dropsolid commentedClosing as outdated because no activity in a long time and Drupal 7 goes EOL soon. Feel free to re-open if needed.