Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Using Dropdown Filter on Bool is not working

Using Dropdown Filter on Bool is not working 21 Feb 2016 23:48 #13834

  • jonathanbell
  • jonathanbell's Avatar
  • Offline
  • Premium Member
  • Posts: 147
  • Thank you received: 5
  • Karma: 1
When using the drop down filter for bool fields , it does not work. Regardless of selecting yes or no the list remains the same.
The administrator has disabled public write access.

Using Dropdown Filter on Bool is not working 07 Mar 2016 19:45 #13848

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
In the plural model there is an error in this.
Somewhere above $this->applySqlStates($query); in the prepareQuery function you probably have:
		//WHERE - FILTER : SomeBool
		if($filter_somebool = $this->getState('filter.somebool'))
		{
			if ($filter_somebool !== null){
				$this->addWhere("a.somebool = " . (int)$filter_somebool);
			}
		}

that does not work, copy the prepareQuery function in a forked plural model file and change the filter for the boolean:
		//WHERE - FILTER : SomeBool
		if($this->getState('filter.somebool') !== null)
			$this->addWhere("a.somebool = " . (int)$this->getState('filter.somebool'));

Cheers
The administrator has disabled public write access.

Using Dropdown Filter on Bool is not working 06 Apr 2016 18:51 #13877

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Fixed.

Might be better now.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: jonathanbell
Time to create page: 0.082 seconds

Get Started