Support from Acquia helps fund testing for Drupal Acquia logo

Comments

darol100 created an issue. See original summary.

david_garcia’s picture

Category: Bug report » Support request

If I need this for a D8 project and are forced to port it I will of course share. But as always and until that happens - if it ever does- if you really need this either port it yourself or pay someone to port it.

Changing this to support request.

twistor’s picture

Category: Support request » Task

I am currently porting this to D8 on behalf of CivicActions.

The current code is here https://github.com/twistor/views_selective_filters. It's working to some extent. Can someone create the 8.x branch? I will most likely roll a patch tomorrow.

nerdstein’s picture

twistor - can you post a patch for a potential release?

twistor’s picture

Status: Active » Needs review
FileSize
43.73 KB

david_garcia’s picture

Status: Needs review » Needs work

Just commited your patch to an orphan branch to get started. Yet this still needs work.

    // if (empty($this->view->selective_oids)) {
    //   $form['#attached']['js'][] = drupal_get_path('module', 'views_filters_selective') . '/js/attachBehaviours.js';
    // }

This needs to be brought back.

protected function getOriginalOptions() {
    if (!isset($this->originalOptions)) {
      // $this->originalOptions = FALSE;
      // $class = $this->definition['proxy'];
      // $original_filter = new $class([], '', []);
      // if (is_callable(array($original_filter, 'getValueOptions'))) {
      //   $original_filter->set_definition($this->definition);
      //   $options = $original_filter->getValueOptions();
      //   // We store only non-empty array.
      //   if (is_array($options) && !empty($options)) {
      //     $this->originalOptions = $options;
      //   }
      //   else {
      //     $this->originalOptions = array();
      //   }
      // }
    }

    return $this->originalOptions;
  }

This too.

twistor’s picture

Title: [meta] Views Selective Filters D8 Port » $commands[] = ajax_command_invoke(NULL, "attachBehaviors");[meta] Views Selective Filters D8 Port
    // if (empty($this->view->selective_oids)) {
    //   $form['#attached']['js'][] = drupal_get_path('module', 'views_filters_selective') . '/js/attachBehaviours.js';
    // }

hook_views_ajax_data_alter() is gone, so at this point, attachBehaviors() would never get called. I will test to see if the block refresh is still an issue.

twistor’s picture

Title: $commands[] = ajax_command_invoke(NULL, "attachBehaviors");[meta] Views Selective Filters D8 Port » [meta] Views Selective Filters D8 Port
david_garcia’s picture

hook_views_ajax_data_alter() is gone, so at this point, attachBehaviors() would never get called. I will test to see if the block refresh is still an issue.

The thing is to make sure that the original issue that that thing was fixing is not reintroduced in 8.x

The commit where this was fixed is this one:

f781b358710092e5a01d3c573063c603a1768d40

But it has no associated issue. I surmise from the changes in the commit that the issue was that views selective filters in an exposed block where not working.

twistor’s picture

matsbla’s picture

I tested the d8 branch now, seems like the block is not filtering/refreshing when I click "apply".
Is this the only issue left? Or could we create a branch and create different issues that needs to be fixed for a D8 release?

david_garcia’s picture

Is this the only issue left?

There is a lot of work yet to be done. To my understanding thus was just a POC.

smk-ka’s picture

@david_garcia It's already working quite good for basic use cases (will post some bug fixes soon). I think it would make more sense to create new issues for the problems identified above and close this issue.

whop’s picture

Hello,
to which version of 7 dev should be patched used?

I got this:
The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\views\Plugin\views\field\EntityField::createEntityForGroupBy() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /var/www/sites/ripn/www/core/modules/views/src/Plugin/views/field/EntityField.php on line 823 in Drupal\views\Plugin\views\field\EntityField->createEntityForGroupBy() (line 865 of core/modules/views/src/Plugin/views/field/EntityField.php).

Using with entity api module, and Drupal 8.3 dev
Thanks a lot!
this module is great and I need it again :)

Adrian83’s picture

Great module in Drupal 7. Looking forward to having it in Drupal 8. Is there an official way to sponsor porting projects?

hyperlinked’s picture

Thanks so much for working on this. For the most part it works, but I found one issue that I've added to your Github project. Replacement Patterns in Rewrite Results text patterns aren't being processed.

Adrian83’s picture

Needed this for a second project. I tried the module from github, and it filtered down my exposed filter list, but it the exposed filter no longer worked, meaning that it didn't filter down my results anymore.

sneo’s picture

Works for me ! Thx for the port !

migdaliabrito’s picture

The module port does not seem to work with entity reference fields:
https://github.com/twistor/views_selective_filters/issues/4

A SQL error is given when submitting the form.

Can we get a patch for this?

tmountjr’s picture

I posted this over at the GH port as a PR, but I'll drop it here too. My original troubleshooting on the PR: https://github.com/twistor/views_selective_filters/issues/4#issuecomment...

Basically somehow the view is dropping the _target_id suffix of the table name when dealing with entity reference fields (if it ever had it to begin with). I don't know if that's the fault of the port or Drupal or some combination of the two, but facing a deadline the easiest way to fix it was to use hook_views_query_alter to fix the field names before passing the query off to the database.

I'd love to continue the conversation about why this is happening and what the correct way to fix it is; in the meantime this worked for my (limited) use-case.

RokSen’s picture

Not wokr to me :(

The website encountered an unexpected error. Please try again later.
TypeError:
Drupal\Core\Database\DatabaseExceptionWrapper: Exception in Desiqns[designs]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node__field_sirina.field_sirina' in 'where clause': SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node_field_data} node_field_data LEFT JOIN {node__field_sirina} node__field_sirina ON node_field_data.nid = node__field_sirina.entity_id AND (node__field_sirina.deleted = :views_join_condition_0 AND node__field_sirina.langcode = node_field_data.langcode) WHERE (node_field_data.type IN (:db_condition_placeholder_0)) AND (node_field_data.status = :db_condition_placeholder_1) AND (node__field_sirina.field_sirina IN (:db_condition_placeholder_2))) subquery; Array ( [:db_condition_placeholder_0] => dekor [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => 1200 [:views_join_condition_0] => 0 ) in Drupal\views\Plugin\views\query\Sql->execute() (line 1488 of core/modules/views/src/Plugin/views/query/Sql.php).

johnpicozzi’s picture

Can we get this in a dev release on d.o?

Leagnus’s picture

#21 works for me
on Drupal 8.5.x-dev
with ajax + exposed filters in a block.
tmountjr, thank you a lot!

bmcclure’s picture

I needed an easy way to install this with composer in 8.x, so I forked the GitHub repo, applied the patch from the PR, and added a composer.json file. If anyone else is in that same boat, the repo is here: https://github.com/bmcclure/views_selective_filters

Note that none of the work there is mine, it's just a convenient way to install the most-working (I think) D8 version at the moment until such time as it's officially released here (or the original Github repo is updated)

geek-merlin’s picture

@bmcclure: Thanks for putting everything together! (Not only coding is important work.)

bmcclure’s picture

I'm running into some issues using this code. Some filter values show up twice in a row, and some other filter values don't show up at all.

I'm going to see about resolving it in my repository if I can.

bmcclure’s picture

It seems very difficult (maybe not possible) to get the existing code working with a taxonomy reference field where you have multiple values you want to filter by, while only showing the row once in Views. This module was simply getting the first value from a list of multiple, regardless if it was the correct one or not. Also, the labels seemed to only match one of the values.

I've refactored a little bit of the code in my repository, as well as added an option in the filter settings to select an entity type to use to look up labels from, instead of trying to get the label from the field style settings in the View. If an entity type is selected, it'll use that, and if not, it'll work as before (except it'll loop through multiple values in fields instead of only using one of them).

This will need more testing and probably some more refactoring, but as of now it's working for my use case.

rang501’s picture

@bmcclure thank you for your work!
Your code seems to be working but one thing doesn't - if I add two selective filters and change first one then the second one won't change, I can still select options which shouldn't be there anymore (will cause view to show zero results message).
It seems to update items when changing non-selective filter.

I wasn't able to debug why this happens. I even don't know if this should work like this.
Using ajax enabled view.

bmcclure’s picture

Interesting--I haven't had much of a chance to debug this further. I'll see if I can reproduce the issue you're running into, and can hopefully get that resolved.

I've also noticed that it seems to work counter-intuitively right now, limiting the options of a select field based on your existing choice in that same select field. The result in my testing seems to often be that I end up with a select field with only a few results after I select something in the field. It seems like it should ignore that particular filter when determining which values to remove, but I wasn't able to get that working right yet. I'll see if I can get some more time to dedicate to cleaning up the code so that we have a better working D8 version.

agnese.stelce’s picture

Successfully set up https://github.com/bmcclure/drupal-views_selective_filters Views Selective Filters for Taxonomy Term entity reference field on multi-lingual site but found out that term names on filter are not translated. Tried to solve the issue on attached patch.

bmcclure’s picture

I can get this change merged into the GitHub repo as well. Feel free to submit a PR to GitHub, otherwise I'll apply and test the above patch ASAP. Thanks!

Also, I'd be happy to help maintain the D8 version of this module if the existing maintainer would approve. I would be happy to get the current work from my GitHub fork committed to an official 8.x branch so we can start getting more D8 testing and community involvement.

mizage@gmail.com’s picture

Anyone using Taxonomy terms in the filter?

I'm getting some interesting behavior where labels are duplicated, but the IDs are correct:

<option value="22">Guide</option>
<option value="17">Guide</option>
<option value="28">Memo</option>
<option value="27">Memo</option>
<option value="29">Newsletter</option>
<option value="30">Notice</option>
<option value="32">Poster</option>
<option value="12">Poster</option>
<option value="34">Presentation</option>
<option value="105">Video</option>

EDIT This was fixed by selecting "Taxonomy Term" as the Entity type.

jmtew58’s picture

FileSize
197.32 KB
113.89 KB

Good Afternoon All,
I have been doing some testing with this module and noticed something that seems odd to me. When I select an option in one filter, all the other filters update except that one I selected. Screenshots below illustrate what I mean. Here is the initial view:
initial
After I select the 'Air Quality' Keyword filter, I get a handful of results in the view, and I would expect the vast majority of the Keywords to be removed, but they are all still present:
updated

jmtew58’s picture

Greetings,
I am having a strange quirk with this module. When I add multiple filters and make a selection, all the filters update except the one I selected. There are still selections available in the selected filter which are not available in the results. If I select multiple items in the same filter, they seem to take on an "OR" logic. Hope this makes sense, it's hard to explain exactly. Otherwise things are working nearly perfectly.

proweb.ua’s picture

last dev https://github.com/bmcclure/drupal-views_selective_filters
drupal 8.4.4
Field type List (text) or List (integer)

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node__field_test.field_test' in 'where clause': SELECT DISTINCT node_field_data.nid AS nid, node_field_data.langcode AS node_field_data_langcode, node__field_test.field_test_value AS node__field_test_field_test_value, node__field_type.field_type_value AS node__field_type_field_type_value, taxonomy_index.sticky AS taxonomy_index_sticky, node_field_data.title AS node_field_data_title, taxonomy_index.created AS taxonomy_index_created, MIN(node_field_data.nid) AS nid_1 FROM {node_field_data} node_field_data LEFT JOIN {taxonomy_index} taxonomy_index ON node_field_data.nid = taxonomy_index.nid LEFT JOIN {node__field_test} node__field_test ON node_field_data.nid = node__field_test.entity_id AND node__field_test.deleted = :views_join_condition_0 LEFT JOIN {node__field_type} node__field_type ON node_field_data.nid = node__field_type.entity_id AND node__field_type.deleted = :views_join_condition_1 WHERE (node_field_data.nid IN (SELECT tn.nid AS nid FROM {taxonomy_index} tn LEFT OUTER JOIN {taxonomy_term_hierarchy} th ON th.tid = tn.tid LEFT OUTER JOIN {taxonomy_term_hierarchy} th1 ON th.parent = th1.tid LEFT OUTER JOIN {taxonomy_term_hierarchy} th2 ON th1.parent = th2.tid WHERE (tn.tid = :db_condition_placeholder_2) OR (th1.tid = :db_condition_placeholder_3) OR (th2.tid = :db_condition_placeholder_4))) AND ((node_field_data.langcode IN (:db_condition_placeholder_5)) AND (taxonomy_index.status = :db_condition_placeholder_6) AND (node__field_test.field_test IN (:db_condition_placeholder_7))) GROUP BY node_field_data.nid, node_field_data_langcode, node__field_test_field_test_value, node__field_type_field_type_value, taxonomy_index_sticky, node_field_data_title, taxonomy_index_created ORDER BY taxonomy_index_sticky DESC, node_field_data_title ASC, taxonomy_index_created DESC; Array ( [:db_condition_placeholder_2] => 94 [:db_condition_placeholder_3] => 94 [:db_condition_placeholder_4] => 94 [:db_condition_placeholder_5] => ru [:db_condition_placeholder_6] => 1 [:db_condition_placeholder_7] => База под макияж [:views_join_condition_0] => 0 [:views_join_condition_1] => 0 )

igonzalez’s picture

@david_garcia @twistor @bmcclure
I have implemented the module (https://github.com/bmcclure/drupal-views_selective_filters) in several of my projects and it works acceptably. I think they should move it to alpha to make the module and work more visible.
Great migration work.

Greetings and thanks

sinn’s picture

Module looks abandoned. Might be someone wants to be a co-maintainer?
Definitely need to go ahead and open dev branch for D8 version.

W01F’s picture

Any news on the D8 port - specifically a port that would be compatible with Better Exposed Filters ><?

demonde’s picture

I tested the github version and it works in some cases. It would be great to have a 8.x.-1.x-dev and a roadmap including what works and what does not at the moment.

droddis’s picture

is anyone using this on a production site?

hyperlinked’s picture

Droddis, I have this installed on a production site, but it's not one that's widely used by the general public and it's only used by a few dozen backend users. Those users do use it quite heavily and I haven't had any problems with the way it was deployed. It's been some time since I did development on that site so I can't recall exactly what issues I had to get around. I do remember that I had to devise workarounds or abandon some typical uses for this module, but overall it's working ok for me.

Anybody’s picture

I also agree with #41 to create a dev release and adding the maintainer from https://github.com/bmcclure/drupal-views_selective_filters. At least it should be linked on the module page otherwise.

Anybody’s picture

I also agree with #41 to create a dev release and adding the maintainer from https://github.com/bmcclure/drupal-views_selective_filters. At least it should be linked on the module page otherwise.

droddis’s picture

thanks @hyperlinked. I've got it installed for a very basic implementation of taxonomy terms and so far it doesn't seem to be failing or bugging. I'll keep an eye on it but certainly nothing jumped out as being specifically problematic. I would suggest that based on my limited test it's probably find to be rolled into a dev version.

krabbe’s picture

Thanks to everyone transferring this module into D8! I was trying to do something like that on my own and lost nearly two days, before I found this module. I installed it on a site with heavy use of huge taxonomy lists, together with better-exposed-filters and ajax activated. I use filters on all the term list pages, for the beginning I started with two filters, city and company. Only options leading to results are visible, and if I select one of them, the content is filtered directly using ajax. Very good!

There are two issues though. There is an option in the list with no label and resulting in no results when clicked. It's the second item in the options list, directly after the "all" item. It's easy to fix on my own with css, but I or someone should dig into it to find the reason for that.

The other thing is more important to me: When I choose an item in one filter, the options in the second filter should update and the now empty terms should be removed. Not every node with a city term has also a company term.
I don't know, how do that. Is there an easy way to add css classes to empty items using javascript? But maybe this should go into feature request, when the module is rolled out to drupal dev.

bezlash@gmail.com’s picture

Hi,

Really looking forward to the dev release for this module. Just wondering roughly when we think the dev release will be released?

Thanks

Adrian83’s picture

Is there a volunteer to maintain a Drupal 8 branch? This appears to be the official procedure to get permission to open a dev branch: https://www.drupal.org/node/251466

caspervoogt’s picture

I love the Github version! Thanks very much for that. I'd love to see this get into the D8 branch for this module.

Rajeshreeputra’s picture

I tried #25 patch/code i.e. https://github.com/bmcclure/views_selective_filters in my D8 site which has more that 10K records. site is working but the page where I have used this exposed filter is not working. It gives me "PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /docroot/core/lib/Drupal/Core/Cache/DatabaseBackend.php on line 166".

edit: I've changed memory limit from 128 to 512 and max execution time set to 0, guess what it started working. I'm looking into few changes in the current version to make it work in batch process so we may not need to change memory limit and max execution time.

danharper’s picture

@Rajeshreeputra I have the same problem, I've tried using elastic search with search api but the problem is that it inly shows filters for results in the pager. This is probably not the best place to raise issues as this is to discuss getting the port on to Drupal.org

Leagnus’s picture

Column not found: 1054 Unknown column
This error appears if you do selection from simple field.
Change simple field to term reference fiels to fix.

bmcclure’s picture

I'm still using this on a production site, however, I do believe there are a number of issues which need to be solved. I am not very surprised about the memory error, I think this likely needs some optimization as well, as it's doing some pretty significant Views operations under the hood that I imagine could at least double the memory a view with a selective exposed filter uses. Though it could also be due to a bug.

I would be willing to help maintain the D8 version of the module if the module author desires assistance (or has no interest in working on the D8 version). I have ported a number of modules to D8 and maintain a number of my own modules as well. My time is somewhat limited lately, but I could certainly get a D8 branch going on here with the existing code and make an alpha roadmap that I and the community could start chipping away at.

I feel it would be very beneficial to get this up on Drupal.org ASAP; more of the community might be willing to contribute if the module followed a more standard Drupal development workflow instead of another version living in Github.

igonzalez’s picture

That's great. I'll be attentive to help in any way I can.

vrwired’s picture

This works great on my local lando/docker, but when implemented on dev server (centos Red Hat 4.8.5-16) I can't enable the module without error.

Maybe it's the way I've installed as am unsure how to install via composer when cannot composer install require it like normal... how would I get this installed via composer? https://www.jeffgeerling.com/blog/2018/converting-non-composer-drupal-co... looks like may have answers but haven't really dug into it.

I even tried restoring my local db onto stage using BAM - same issue. The error reverted to /core/install.php with output:

Additional uncaught exception thrown while handling exception.

Original

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: CREATE TABLE {cache_default} ( `cid` VARCHAR(255) CHARACTER SET ascii BINARY NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.', `data` LONGBLOB NULL DEFAULT NULL COMMENT 'A collection of data to cache.', `expire` INT NOT NULL DEFAULT 0 COMMENT 'A Unix timestamp indicating when the cache entry should expire, or -1 for never.', `created` DECIMAL(14, 3) NOT NULL DEFAULT 0 COMMENT 'A timestamp with millisecond precision indicating when the cache entry was created.', `serialized` SMALLINT NOT NULL DEFAULT 0 COMMENT 'A flag to indicate whether content is serialized (1) or not (0).', `tags` LONGTEXT NULL DEFAULT NULL COMMENT 'Space-separated list of cache tags for this entry.', `checksum` VARCHAR(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The tag invalidation checksum when this entry was saved.', PRIMARY KEY (`cid`), INDEX `expire` (`expire`), INDEX `created` (`created`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT 'Storage for the cache API.'; Array ( ) in Drupal\views\ViewsData->cacheSet() (line 209 of /var/www/stagesnorkel/web/core/modules/views/src/ViewsData.php).

It really seems like this may be that I have not correctly installed this via composer... I only cloned it and switched to 8.x-1.x branch. Running composer install/update in that directory didn't appear to do anything.

Can anyone advise on how to add a non-official drupal module via composer?

vrwired’s picture

As follow up to my issue in case helps someone else, it was not anything to do with composer but with the 'mysql server has gone away' I realized it to be a need to increase max_allowed_packet in my.cnf file (as described here: https://www.drupal.org/node/259580)...

...also noteworthy is that this module can alter/grow queries/cache extensively which must be why need increase memory: https://drupal.stackexchange.com/a/204300

colan’s picture

I just sent the current maintainer a message about #54 so that we can get this moving again.

adamcadot’s picture

We must coordinate efforts with core's handling of Views Exposed Filters for Entity Reference fields.

demonde’s picture

@colan: Did you get an answer from the maintainer? In this thread his last comment is two years old. So it looks to me he is not an active maintainer any more.

colan’s picture

It's been more than 2 weeks so I'd recommend that someone who's interested in taking over maintenance pick up the process at Dealing with unsupported (abandoned) projects. Normally I would, but I don't need this module right now.

Please link to that new issue from here. Thanks!

smithkr’s picture

Hi there,

Has there been any news on a maintainer for this project? (See #54.) It seems a lot of people are looking for this port, and I'd be happy to help with documentation. Thanks!

Kris77’s picture

Hi guys,
I'm still using this on a production site and it seems to work.

I downloaded the Github version proposed in #51.

TravisJohnston’s picture

Just to add #51 at Github works great.

bmcclure’s picture

I'd still be happy to become the maintainer of the D8 version of this module and at least starting with my Github version so we have something to start accepting patches for.

I haven't gotten around to going through the process of trying to take over maintainership of it yet, but I can start to get the ball rolling soon if we don't hear from the existing maintainer.

alphex’s picture

No where else to post this... but I'd appreciate any help here : https://github.com/twistor/views_selective_filters/issues/7

Thanks!

Etroid’s picture

Let's start the process for taking over maintainership of this module. It's been several years since the original maintainer last responded.

tonytheferg’s picture

https://www.drupal.org/project/selective_better_exposed_filters

This module does the basic function of selective filters.

Anybody’s picture

Perhaps someone could contact the maintainer @david_garcia, if he's interested in further 8.x development or would like to grant maintainership for 8.x to someone else? (Who should be experienced with that)

rutan’s picture

I also need this module

margyly’s picture

We need it for UUA.org, too.

Kasey_MK’s picture

FileSize
584 bytes

The code at https://github.com/bmcclure/drupal-views_selective_filters works for us with the change made in PR 2 (Check if key is defined befory loading the entity, fix array_flip warning). Since that hasn't been merged, I'm including a patch for it here.

Since I had to look up how to install from GitHub via composer, I'll post my steps in case it helps others:

In my composer.json, under "repositories" (I tried using version "8.x-1.x" but got errors so I cheated with "8.1"; if you don't already have an "extra" section set up to define drupal-modules you'll need to do that too):

 {
  "type": "package",
  "package": {
    "name": "bmcclure/views_selective_filters",
    "version": "8.1",
    "dist": {
      "url": "https://github.com/bmcclure/drupal-views_selective_filters/archive/8.x-1.x.zip",
      "type": "zip"
    },
    "require": {
      "composer/installers": "^1.2.0"
    },
    "type": "drupal-module"
  }
}

In composer.patches.json under "patches" (we use cweagans/composer-patches):

"bmcclure/views_selective_filters": {
  "Check if key is defined before loading the entity, fix array_flip warning - https://github.com/bmcclure/drupal-views_selective_filters/pull/2": "https://www.drupal.org/files/issues/2020-02-06/check_for_key.patch"
}

Then I ran composer require bmcclure/views_selective_filters

Another "gotchya" I ran into (using multiple selective filters on a single view): my filter selection fields sometimes showed lots of duplicate items - and didn't include all the items used. They also sometimes had HTML characters without encoding. I solved both problems by using the "Entity type" field on each filter's settings (Taxonomy term or Content in my case).

Thank you all who have worked on this! Can't wait to see it on drupal.org.

philltran’s picture

I created a support issue and contacted the maintainer to see if he would grant co-maintainership to allow posting the D8 version of the module. Thanks everyone for their work on this.

geek-merlin’s picture

Great that this got some traction! I am very interested in this module and can help (with or without comaintainer status). Feel free to PM me on that.

shortspoken’s picture

Thats great news! I can try and help testing and debugging.

markanderson3’s picture

Does the module in github work with any fields other than Taxonomy Reference? I'm getting "SQLSTATE[42S22]: Column not found" errors when trying to use it to filter Boolean and Text (list) fields.

Kris77’s picture

@markanderson3 I'm also using this form with two select list fields in my web site without problems.

And as @Kasey_MK, I also using multiple selective filters on a single view: my filter selection fields sometimes showed lots of duplicate items - and didn't include all the items used. They also sometimes had HTML characters without encoding. I solved both problems by using the "Entity type" field on each filter's settings.

Thanks @Kasey_MK.

An official version? Is it possible to publish it?

tassilogroeper’s picture

Hi Folks,

I came here since my Drupal 8.8 update failed for this module. Throwing the following error in the frontend:

Notice: Indirect modification of overloaded property Drupal\ctools_views\Plugin\Display\Block::$display_options has no effect in Drupal\views_selective_filters\Plugin\views\filter\Selective->getOids() (line 371 of modules/contrib/views_selective_filters/src/Plugin/views/filter/Selective.php).
Drupal\views_selective_filters\Plugin\views\filter\Selective->getOids() (Line: 87)
Drupal\views_selective_filters\Plugin\views\filter\Selective->getValueOptions() (Line: 115)
Drupal\views_selective_filters\Plugin\views\filter\Selective->valueForm(Array, Object) (Line: 922)
Drupal\views\Plugin\views\filter\FilterPluginBase->buildExposedForm(Array, Object) (Line: 115)
Drupal\views\Form\ViewsExposedForm->buildForm(Array, Object)

I found the pull request https://github.com/bmcclure/drupal-views_selective_filters/pull/3 - but it did not work.
So here is mine:
https://github.com/bmcclure/drupal-views_selective_filters/pull/4

igonzalez’s picture

I also need this module

devnyc’s picture

Hi all - thanks for the really good work on getting this port up and running. Wondering if there's currently any option for hierarchical display of the selective filter. I have A number of primary categories, each with multiple sub-categories. So far in playing around with this module (installed from github) I'm unable to be able to replicate the same hierarchy display as the original non-selective BEF filter. Any thoughts?

Thanks!

joelpittet’s picture

@devnyc re #80, I think that may beyond the scope of this module.
@igonzales re #79 have you tried the dev branch release out?
@tassilogroeper re #78, I've #3161947: Notice on getOids() method which looks like the same fix.
@Kris77 re #77 I may roll an alpha soon just need to do some manual testing first.

MrPaulDriver’s picture

It would be good to see this moving again.

I have successfully been using Better Selective Views Filters but since Drupal core stopped shipping with jQuery, this module's main dependency Better Exposed Filters, is now installing a number of jQuery modules which I do not need and would rather not have in my codebase.

composer require drupal/selective_better_exposed_filters

- Installing drupal/jquery_ui (1.4.0)
- Installing drupal/jquery_ui_datepicker (1.0.0)
- Installing drupal/jquery_ui_slider (1.1.0)
- Installing drupal/jquery_ui_touch_punch (1.0.0)
- Installing drupal/better_exposed_filters (5.0.0-beta1)
- Installing drupal/selective_better_exposed_filters (2.0.0-beta6)

That's a lot of overhead.

joshua.boltz’s picture

I just tried installing this module, and I am not seeing any jQuery UI modules being pulled in.
But, that note was back when the module was 2.0.0, but now the latest version is 3.0.2, so it seems that issue has been resolved.