Skip to content

Commit

Permalink
Add empty option to data type select
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Dec 10, 2024
1 parent c291e3f commit 47d6966
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/src/View/Helper/DataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getSelect($name, $value = null, $attributes = [], $options = [])
$valueOptions = array_merge($valueOptions, $optgroupOptions);

$element = new Select($name);
$element->setEmptyOption('')
$element->setEmptyOption($options['empty_option'] ?? '')
->setValueOptions($valueOptions)
->setAttributes($attributes);
if (!$element->getAttribute('multiple') && is_array($value)) {
Expand Down
2 changes: 1 addition & 1 deletion application/view/common/advanced-search/properties.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ if ($this->status()->isSiteRequest()) {
<?php echo $queryOption('ndt', $property, 'type', $translate('does not have data type')); ?>
</select>
<?php echo $queryText($property, $index); ?>
<?php echo $this->dataType()->getSelect($stem . '[text]', $property['text'] ?? null, ['class' => 'query-text-data-type']); ?>
<?php echo $this->dataType()->getSelect($stem . '[text]', $property['text'] ?? null, ['class' => 'query-text-data-type'], ['empty_option' => $translate('Select data type…')]); ?>
<button type="button" class="o-icon-delete remove-value button" aria-label="<?php echo $translate('Remove value'); ?>" title="<?php echo $translate('Remove value'); ?>"></button>
</div>
<?php
Expand Down

0 comments on commit 47d6966

Please sign in to comment.