Closed (outdated)
Project:
Drupal core
Version:
10.1.x-dev
Component:
views.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 May 2016 at 11:25 UTC
Updated:
15 Jan 2023 at 01:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
damiankloip commentedComment #4
dawehnerThis looks perfect!
Comment #5
damiankloip commentedComment #6
damiankloip commentedComment #7
damiankloip commentedComment #8
damiankloip commentedComment #9
jibranHow about
$value = $this->value !== 'All' ? (int) $vlaue : 'All';this for simplicity?Comment #10
mayurjadhav commentedHi Agreed with you, Assigning to me.
Comment #11
mayurjadhav commentedUsed ternary Operations and uploaded new patch.
Comment #12
mayurjadhav commentedComment #15
lendudeSeems pretty related to #1381140: A #default_value = 0 for #type radios checks all radios
Comment #16
damiankloip commentedIMO, the original way is simpler and far more readable. Less lines != simplicity. So I would say let's go with the patch in #5 please :) Also the patch in #11 just copied the variable typo from #9 anyway.
@lendude, this was more a problem due to https://www.drupal.org/node/2732111, which is fixed, but I think it makes sense to do this anyway.
Comment #17
lendude@damiankloip Seems like #2732111: Reset button doesn't work and never gets removed on AJAX enabled views fixed it indeed, I can't reproduce this anymore using the steps in the IS. So do you think we should still make these changes more as hardening then an actual bug fix?
So change this from bug to task?
Or just leave it as is and close this?
Comment #18
damiankloip commentedYeah, that issues basically fixed all the related issues, but just kind of sidesteps this issue. I think we make this a task now and still try to get it in.
Comment #20
mkalkbrennerre-rolled against 8.4.x and fixed the failure in #11.
Comment #21
damiankloip commentedGood to see this moving again! can we revert the ternary changes as per #16 please?
Comment #22
mkalkbrennerThe error seems to exist in multiple layers. To get my setup to work I had to fix #2712131: D8: Views: UI: -Any- option for non-required boolean yes/no filter won't stick as well.
And from point of view we have a real bug here, not a task. And it's not just limited to Ajax.
Comment #23
sk33lz commentedThe patch from #20 applies cleanly to 8.4.x and creating a view as per the OP's description keeps the proper exposed filter settings.
This should be RTBC.
Comment #24
tstoecklerThis should still be updated per #21 / #16.
Also:
This comment doesn't really make sense to me. It seems we are casting to int unless the value is 'All', but the comment makes it seem like it's the other way around.
Comment #25
damiankloip commentedYes, that was my bad in the original patch.. Should be "Cast to an int unless 'All' is used.." I think.
Comment #26
mkalkbrennerI prefer the ternary operator. But I don't won't to block the solution here.
Comment #28
mkalkbrennerCI caused the fail. Retest succeeded.
Comment #29
tstoecklerI think this could use a test. I also don't 100% grok this issue yet, so I will use writing a test as an opportunity to fix that.
Comment #30
tstoecklerHmm... so I followed the steps to reproduce in the issue summary but I couldn't reproduce the issue. The attached patch is a test that follows the steps to reproduce, as well. And it passes, instead of failing. Note that the title mentions "AJAX-enabled", but I couldn't reproduce this behavior with or without AJAX, so the patch currently leaves that out.
Marking "needs review", but this is really "needs work" until we get a failing "tests-only" patch.
Comment #31
tstoecklerComment #32
tstoecklerComment #33
lendude@tstoeckler I think the actual issue was solved by #2732111: Reset button doesn't work and never gets removed on AJAX enabled views and the issue @mkalkbrenner ran into is solved by #1381140: A #default_value = 0 for #type radios checks all radios so I think this can be reset to a Task again, just for internal hardening of the used values, see #17/#18
Comment #34
tstoecklerHmm... OK. Tagging "Needs issue summary update" then. It would be great to clarify what is being "hardened" here.
Comment #44
andypostit needs code comment - why default value should "All" when no value?
Comment #45
andypost@Lendude it's not solved yet, see #2745723: Exposed filter using checkbox always checked (e.g. history is-new)
Comment #48
quietone commentedI tested this on Drupal 10.1.x, umami install. I added a boolean to a new content type and followed the steps in the Issue Summary. I was not able to reproduce the problem. After filtering on 'any', 'true' or 'false' and then clicking 'reset' the filter was set to the default value of True.
Therefor, I am closing this as outdated.
Thanks.