Skip to content

Commit

Permalink
Merge pull request #365 from City-of-Helsinki/develop
Browse files Browse the repository at this point in the history
Release 19.12.
  • Loading branch information
tvalimaa authored Dec 19, 2022
2 parents 0b84428 + 3a86555 commit 6c5a5fa
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
12 changes: 12 additions & 0 deletions conf/cmi/ultimate_cron.job.search_api_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ module: search_api
callback: search_api_cron
scheduler:
id: simple
configuration:
rules:
- '*/5+@ * * * *'
launcher:
id: serial
configuration:
timeouts:
lock_timeout: 3600
launcher:
thread: 0
logger:
id: database
configuration:
method: '3'
expire: 1209600
retain: 1000
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
if ($form_state->getValue('apartment')) {
// Get apartment data.
$apartments = $form_state->getValue('apartment');
// Clear add more.
if (isset($apartments['add_more'])) {
unset($apartments['add_more']);
}
// Check that apartment has more than 1 value.
// Check that if first apartment data if 0.
if (count($apartments) <= 1 && $apartments[0]['id'] == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public function buildForm(array $form, FormStateInterface $form_state, string $u
'#value' => t('Submit'),
];

$form['#cache'] = ['max-age' => 0];

return $form;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
$element['personal_id'] = [
'#type' => 'textfield',
'#title' => $this->t('Personal id'),
'#description' => $this->t('last 5 characters'),
'#description' => $this->t('last 4 characters'),
'#minlength' => 5,
'#maxlength' => 5,
'#default_value' => $items->getValue()[$delta]['personal_id'] ?? '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ protected function singleComputeValue() {
'#markup' => '',
];
}
// Strip spaces out of a apartment mumber value.
$apartment_number = trim(str_replace(' ', '', $apartment->field_apartment_number->value));
return [
'#markup' => $apartment->getApplicationUrl($apartment->id()),
'#markup' => $apartment->getApplicationUrl($apartment_number),
];
}

Expand Down
4 changes: 2 additions & 2 deletions public/modules/custom/asu_content/translations/fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -40466,8 +40466,8 @@ msgstr "Valitse huoneisto"
msgid "Add additional applicant"
msgstr "Lisää kanssahakija"

msgid "last 5 characters"
msgstr "Viimeiset 5 merkkiä"
msgid "last 4 characters"
msgstr "Viimeiset 4 merkkiä"

msgid "Save as a draft"
msgstr "Tallenna luonnoksena"
Expand Down

0 comments on commit 6c5a5fa

Please sign in to comment.