I have the same view with the same filters I re-use for different taxonomy pages, yet sometimes this error is diplayed.

I can't get the error message/ warning message to hide, even with error reporting set to only log messages. Even third party modules like Disable Messages can't prevent the message from showing to end users. I think that's a bug in itself, but I'm not sure what the message itself means.

1 - Improve the message shown to users when the filter's number of options have been limited by the module.
2 - Instead of a hardcoded value, use drupal_get_variable so that users can customize this setting in a variable, or even better, expose this as a setting in the filter's configuration.

Comments

david_garcia’s picture

Well...this message is a protection against bad use of the module. It is telling you that whatever field you chose for the filter (and in combination with the rest of constraints in the query) results in more than 100 options available for your exposed selective filter. This has been implemented to prevent a missconfigured view to pontentially crash because without this limit you can easily get thousands or more results.

In views_handler_filter_selective.inc:

<?php
     
// We don't want a badly configured selective filter
      // to return thousands of possible values.
     
$max_items = 100;
?>

Try chaning $max_items to something bigger, but with caution.

About the message, it is displayed using the standard "drupal_set_message()" and I believe it should be shown regardless of being desinging the view or during it's regular usage because the limit can appear when playing around with other exposed filters that the user can change.

AlfTheCat’s picture

Hi David,

Thanks for the explanaition.
I think this might be a nice variable to expose to a config ui, so that admins can set this limit or disable its entirely.

The site in question has thousands of products. I actually do want them to all show up, at least initially. In my use case, the purpose of having exposed filters is so that people can narrow down large result sets. And me using this specific module if so that people can filter through them quickly and intuitively. Narrowing a search that yields 10.000 results, down to maybe just 45, for instance. Without refreshing or seeing irrelevant filter options.

Can't I rely on views pagers or the "show a specific number of items" setting to limit results instead of a hardcoded max value? And can I set it to 0 to disable it entirely or should I just comment it out?

Again thanks for the reply and not to mention this awesome module. It really rules!

AlfTheCat’s picture

P.s.

I don't know why the warning is showing up then. I disabled showing warning and error messages, yet it still shows. Maybe a drupal bug somewhere. I'll look into that seperately.

AlfTheCat’s picture

Doh! I think i misinterpreted your answer, you're not referring to the results of the view but to the number of options available to filter on.

Ok. Maybe then I can suggest a more descriptive message? Plus exposing this setting somewhere so that admin's can change it. I think that would be perfect.

Thanks!

Oscar

david_garcia’s picture

Category:Bug report» Feature request
Issue summary:View changes

Ok, so let's turn this into a feature request and out of the bug queue. Issue description updated accordingly.

woozc’s picture

If you don't want message appear, and you know this error in your mind.
Go to /sites/all/modules/views_selective_filters/
find views_handler_filter_selective.inc and open
search key word "limited the amount"
add // to let this line become a comment!!!