Vue on a rewrite of an older Project v8 > v9

I got the solution for this. The :file-id attribute of <concrete-file-input> can not be emptyString, it has to be 0 for a new entry (where no file is selected). So with handlebars i registered a ternary helper and it looks like this now:

<concrete-file-input
    :filters='<?=json_encode([['field' => 'type', 'type' => \Concrete\Core\File\Type\Type::T_IMAGE,]])?>'
    :file-id="{{ ternary image image 0 }}"
    choose-text="<?=h(t('Choose Image'))?>"
    input-name="<?php echo $view->field('highlights'); ?>[{{id}}][image]"
  >
  </concrete-file-input>

So if i create a new repeatable from the template, the file-id is set to 0 instead of empty and that works.

Still appreciate some links to documentation…

1 Like