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.
dependent.js doesn't work currently because it doesn't support being attached multiple times. Fixing that will requires more effort then to migrate to the javascript states framework, so let's just do that.
Comment | File | Size | Author |
---|---|---|---|
#31 | 667950_31-views-numeric_exposed_filter_operator_dependency.patch | 1004 bytes | becw |
#28 | 667950-javascript-states-revert_1_0_2.patch | 54.32 KB | merlinofchaos |
#26 | 667950-javascript-states-revert_1_0.patch | 53.37 KB | dawehner |
#25 | 667950-javascript-states-revert_1_0.patch | 54.55 KB | dawehner |
#24 | 667950-javascript-states-revert_1_0.patch | 54.69 KB | dawehner |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedHere is a starter patch.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedWell, I'm probably going to need dependent.js for CTools too, so I'm not sure just deprecating it is a good idea. They're almost the same code with some slight tweaks.
Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud commented@merlinofchaos Hm? Drupal 7 includes the javascript states framework, which indeed deprecate dependent.js for both Views and CTools. I don't see any reason to keep it, especially if they are "almost the same code with some slight tweaks" :)
Comment #4
dawehnerI guess earl thought that this issue is for 6-3.x
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedSorry, I forgot that the D7 javascript code was horribly called 'states', which sounds to me like something else entirely.
In any case, it still matters to me how much recoding is needed, because converting something working to a new system is not a good use of developer time when there are things that still don't work. =)
Comment #6
Damien Tournoud CreditAttribution: Damien Tournoud commentedAs stated in the OP, Views dependent.js doesn't work currently, because it doesn't support being attached several times, which now happens in D7, since we moved to the new AJAX framework. I don't know if ctools one has the same problem or not. Anyway, the port is quite trivial.
Comment #7
sun+1 for replacing with #states
That comment about check_plain() in the patch makes me nervous... shouldn't we fix this in core instead?
Comment #8
dawehnerSome progress in converting other instances
Comment #9
BenK CreditAttribution: BenK commentedI think I'm experiencing this problem when changing the Views default numeric filter. I'm currently unable to change the filter to anything other than "is equal to". For instance, if I try to change this to "is less than" or "is greater than", the change is not retained upon clicking "update".
--Ben
Comment #10
bojanz CreditAttribution: bojanz commentedEncountered the same thing, just marked #932640: Dependent forms are broken as duplicate.
Comment #11
dawehnerThe current state of states is commited.
There are some places: page display plugin/arguments/some filters which aren't converted totally.
The reason is that there is currently no way to have a input with multiple possible values.
There is a core issue which allows this #735528: FAPI #states: Fix conditionals to allow OR and XOR constructions
Comment #12
bojanz CreditAttribution: bojanz commentedLooks like that won't land in core.... Views or CTools maybe?
Comment #13
dawehnerI thought it would be possible to extend
states.Dependent.comparisons
Comment #14
merlinofchaos CreditAttribution: merlinofchaos commentedCTools will continue to support the old-style dependent code (which is nearly the same as the Views code) so where states doesn't work for us, we can use the CTools dependent code.
Comment #15
dawehnerSo i guess this patch should be reverted?
Comment #16
dawehner@#13
I guess a regexp could have solved it, too.
Comment #17
bojanz CreditAttribution: bojanz commentedI guess using both States and CTools dependent.js is a bit inconsistent.
So, we roll this back, and finally add the dependency to CTools?
EDIT: And the CTools dependency is now present, making it possible to move forward in that direction..
Comment #18
dawehnerhere is the patch which just reverts it.
@TODO
* Require ctools dependency
* throw out views dependency code.
Comment #19
dawehnerNow it should just work :) The hiding works fine but the form elements aren't shown again.
Comment #20
bojanz CreditAttribution: bojanz commentedInteresting, the hiding/showing works as it should for equals & between, but doesn't work right for less than/greater than. Not sure if there's anything special about the less than / greater than fields.
Comment #21
Dave ReidPatch is rolling back the fix to taxonomy autocomplete which is unrelated to states?
Comment #22
dawehner#21
Oh yes thanks
This patch now fixes the add-item form.
Comment #23
dawehnerNew version. This time it really works. Perhaps i forgot to cvs diff
Comment #24
dawehnerHere is the fix for the problem
Comment #25
dawehnerThis time without the dsm
The ctools issue: http://drupal.org/node/958608
Comment #26
dawehnerThis time without the filters
Comment #27
bojanz CreditAttribution: bojanz commentedI can confirm that the latest patch now fixes filter radio boxes (for example, the ones for node: nid).
I also tested some field ones (like "Trim"), and it works.
The only thing I noticed is still broken are the argument radio boxes.
Toggling the "Action to take if argument is not present" radios gives me no change.
I'm really tired so the problem might really be between the chair and the keyboard.
Comment #28
merlinofchaos CreditAttribution: merlinofchaos commentedComment #29
bojanz CreditAttribution: bojanz commentedArguments now work as they should.
Comment #30
dawehnerThanks for helping and testing this issue.
Comment #31
becw CreditAttribution: becw commentedThe committed patch on this issue introduced a bug with exposed numeric filters where no 'value' field appears when the operator select element is <, <=, >, or >=, because the values in the dependency js have
htmlentities()
applied to them.Removing the call to
htmlentities()
fixes the bug. Patch attached.Comment #32
dawehnerThe same issue in the ctools queue: #958608: Dependendcy does not work with option "<="
Comment #33
bojanz CreditAttribution: bojanz commentedWait, wasn't htmlentities() the fix? :/
Comment #34
dawehner@bec
Applying the patch brings up the bug again :( I'm testing with the node: post date filter and node: nid filter.
Comment #35
becw CreditAttribution: becw commented@dereine -- thanks, I guess I'll pursue this over in #958608: Dependendcy does not work with option "<=" (:
Comment #36
bojanz CreditAttribution: bojanz commentedJust a note for anyone following, the ctools issue pointed to a core issue, which now has a RTBC patch: #971120: Radio button values get run through check_plain() twice.
After that lands, we can remove our workaround.
Comment #37
dawehnerCommited to the 7.x branch.