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.


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:

      // 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


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.



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!!!

smitty’s picture

I think, we shouldn't bother a normal user with this message. But it's an important informnation for anybody who is developing/administering such a view.

So, why not reserve this message to such users who have the permission "administer views"?
Furthermore we could write this message into the wachdog ...

To achieve this we have to replace the line

drupal_set_message(t('Selective filter "@field" has limited the amount of total results. Please, review you query configuration.', array('@field' => $ui_name)), 'warning');


        watchdog('Views Selective Filters', t('Selective filter "@field" has limited the amount of total results. Please, review you query configuration.'), array('@field' => $ui_name), WATCHDOG_WARNING);
        if (user_access('adminsiter views')) {
          drupal_set_message(t('Selective filter "@field" has limited the amount of total results. Please, review you query configuration.', array('@field' => $ui_name)), 'warning');
david_garcia’s picture

Status: Active » Closed (works as designed)

This message has a purpose (important) and will not be removed. If you are seeing this message chances are you have something very broken.

The module has been updated so that the user can establish the number of results that will trigger this message. Setting that value to 0 will mean "unlimited" and you will never see it.

This was implemented here:

#2414249: Let the admin decide when a selective is sane