Skip to content

Commit

Permalink
Continue dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Jul 16, 2024
1 parent 0da03d1 commit f4b4f28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion application/asset/js/resource-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
const propertyValue = $(this);
if (propertyValue.val()) {
const propertyId = propertyValue.data('propertyId');
const type = propertyValue.data('type');
const type = propertyValue.data('type') ?? 'literal';
if (!itemData.hasOwnProperty(propertyId)) {
itemData[propertyId] = [];
}
Expand Down
7 changes: 4 additions & 3 deletions application/src/Form/ItemStubForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public function init()
'attributes' => [
'id' => 'item-stub-title',
'data-property-id' => $property->id(),
'data-type' => 'literal',
'data-property-id-default' => $property->id(),
'data-property-label-default' => $translate('Title'),
],
Expand All @@ -105,7 +104,6 @@ public function init()
'attributes' => [
'id' => 'item-stub-description',
'data-property-id' => $property->id(),
'data-type' => 'literal',
'data-property-id-default' => $property->id(),
'data-property-label-default' => $translate('Description'),
],
Expand All @@ -120,7 +118,10 @@ public function init()
],
]);

// Allow modules to modify this form.
// Allow modules to modify this form. Modules may add value elements by
// adding a "data-property-id" attribute to the element, set to the
// property ID. They may also add a "data-type" attribute to the element
// to set a data type that is not "literal".
$addEvent = new Event('form.add_elements', $this);
$this->getEventManager()->triggerEvent($addEvent);

Expand Down

0 comments on commit f4b4f28

Please sign in to comment.