'#title'=>$this->t('Limit number of select items'),
'#type'=>'textfield',
'#description'=>t("Don't allow a badly configured selective filter to return thousands of possible values. Enter a limit or remove any value for no limit. We recommend to set a limit no higher than 100."),
'#description'=>$this->t("Don't allow a badly configured selective filter to return thousands of possible values. Enter a limit or remove any value for no limit. We recommend to set a limit no higher than 100."),
@@ -297,11 +297,11 @@ class Selective extends InOperator {
// Check to see if the user remembered to add the field.
if(empty($fields)){
drupal_set_message(t('Selective query filter must have corresponding field added to view with Administrative Name set to "@name" and Base Type "@type"',
\Drupal::messenger()->addMessage('Selective query filter must have corresponding field added to view with Administrative Name set to "@name" and Base Type "@type"',
[
'@name'=>$ui_name,
'@type'=>$base_field,
]),
],
'error');
return[];
}
@@ -322,11 +322,11 @@ class Selective extends InOperator {
drupal_set_message(t('Selective filter "@name": relationship of field and filter must match.',
\Drupal::messenger()->addMessage('Selective filter "@name": relationship of field and filter must match.',
[
'@name'=>$ui_name,
'@type'=>$base_field,
]),
],
'error');
return[];
}
@@ -372,7 +372,7 @@ class Selective extends InOperator {
$key=is_array($key)?reset($key):$key;
// @todo This double escapes markup.
$value=$style->getField($row->index,$field_id);
$oids[$key]=SafeMarkup::checkPlain($value);
$oids[$key]=Html::escape($value);
}
// Sort values.
@@ -407,7 +407,7 @@ class Selective extends InOperator {
// If limit exceeded this field is not good for being "selective".
if(!empty($max_items)&&count($oids)==$max_items){
drupal_set_message(t('Selective filter "@field" has limited the amount of total results. Please, review you query configuration.',['@field'=>$ui_name]),'warning');
\Drupal::messenger()->addMessage('Selective filter "@field" has limited the amount of total results. Please, review you query configuration.',['@field'=>$ui_name],'warning');