Skip to content

Commit

Permalink
DAMO-325 | Updated category select plugin on asset upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
l-besenyei authored and adam-herczeg committed Jul 3, 2024
1 parent d1b49a6 commit 7d2a558
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/damopen_assets/src/Form/BulkMediaUploadForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,22 @@ public function buildForm(

if ($type !== NULL && $type->id() === 'image') {
$form['category'] = [
'#type' => 'select',
'#type' => 'select2',
'#title' => $this->t('Category'),
'#description' => $this->t('Drag to re-order keywords.'),
'#target_type' => 'taxonomy_term',
'#options' => array_map(static function (TermInterface $term) {
return $term->label();
}, $this->termStorage->loadByProperties(['vid' => 'category'])),
'#tags' => TRUE,
'#selection_handler' => 'default:taxonomy_term',
'#selection_settings' => [
'target_bundles' => ['category'],
'auto_create' => TRUE,
'match_operator' => 'CONTAINS',
'match_limit' => 10,
],
'#multiple' => TRUE,
'#required' => TRUE,
];

$form['asset_name'] = [
Expand Down

0 comments on commit 7d2a558

Please sign in to comment.