diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorResource.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorResource.vue index 1d6a9c970c..8d9e51b2d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorResource.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorResource.vue @@ -112,6 +112,7 @@ export default { type: "select", label: $__("Vendor type"), avCat: "av_vendor_types", + fallbackType: "text", }, { name: "aliases", diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-resource.js b/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-resource.js index 7f2a39c447..4714c8ec45 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-resource.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/composables/base-resource.js @@ -320,9 +320,13 @@ export function useBaseResource(instancedResource) { if (attr.type === "select" && typeof attr.avCat === "string") { const avKey = attr.avCat; const avArray = authorisedValues[avKey]; - attr.options = avArray; - attr.requiredKey = "value"; - attr.selectLabel = "description"; + if ((!avArray || !avArray.length) && attr.fallbackType) { + attr.type = attr.fallbackType; + } else { + attr.options = avArray; + attr.requiredKey = "value"; + attr.selectLabel = "description"; + } } if (attr.type == "relationship" && attr.componentProps) { Object.keys(attr.componentProps).forEach(key => {