Skip to content
Snippets Groups Projects

Issue #3130107: Extend unit test coverage for LanguageNegotiationContentEntity

Open Stefanos Petrakis requested to merge issue/drupal-3130107:3130107-add-unit-test into 10.1.x
3 files
+ 19
164
Compare changes
  • Side-by-side
  • Inline
Files
3
  • 21c5b8d0
    Revert "Issue #2568889 by smustgrave, berenddeboer, Lendude, Anandhi Karnan,... · 21c5b8d0
    Dave Long authored
    Revert "Issue #2568889 by smustgrave, berenddeboer, Lendude, Anandhi Karnan, ckaotik, boromino, diaodiallo, Yago Elias, yashingole, Abhijith S, Amber Himes Matz, dawehner, Scott Weston: Views exposed text filter set to required shows an empty error and form error on page load"
    
    This reverts commit 7a7d73a1.
@@ -246,32 +246,6 @@ public function exposedFormAlter(&$form, FormStateInterface $form_state) {
}
}
// Get an array of exposed filters and exposed required filters,
// keyed by identifier option.
$exposed_filters = [];
$exposed_required_filters = [];
foreach ($this->view->filter as $id => $handler) {
if ($handler->canExpose() && $handler->isExposed() && !empty($handler->options['expose']['identifier'])) {
if ($handler->options['expose']['required'] && $handler->options['plugin_id'] !== 'boolean') {
$exposed_required_filters[$handler->options['expose']['identifier']] = $id;
}
$exposed_filters[$handler->options['expose']['identifier']] = $id;
}
}
// If any required exposed filters loop through them to see if they have any
// input. If not don't auto process the form.
if (!empty($exposed_required_filters)) {
// Prevent form validation if exposed filter is not set.
$exposed_input = $this->view->getExposedInput();
foreach ($exposed_required_filters as $key => $required_filter) {
if (!$exposed_input || empty($exposed_input[$key])) {
$form_state->setAlwaysProcess(FALSE);
break;
}
}
}
if (!empty($this->options['reset_button'])) {
$form['actions']['reset'] = [
'#value' => $this->options['reset_button_label'],
@@ -279,6 +253,13 @@ public function exposedFormAlter(&$form, FormStateInterface $form_state) {
'#weight' => 10,
];
// Get an array of exposed filters, keyed by identifier option.
$exposed_filters = [];
foreach ($this->view->filter as $id => $handler) {
if ($handler->canExpose() && $handler->isExposed() && !empty($handler->options['expose']['identifier'])) {
$exposed_filters[$handler->options['expose']['identifier']] = $id;
}
}
$all_exposed = array_merge($exposed_sorts, $exposed_filters);
// Set the access to FALSE if there is no exposed input.
Loading