Schreibe gerade an einem Plugin und erhalte folgende Fehlermeldung in der Console TypeError: message.split is not a function found in <swproductmediaform>...
Die Komponente wird von mir überschrieben und um eine Funktion erweitert.
import template from './sw-product-media-form.html.twig';
const { Component } = Shopware;
Component.override('sw-product-media-form', {
template,
computed: {
hoverCover() {
if (!this.product) {
return null;
}
return this.product.media.find(media => media.id === this.product.hoverCoverId);
},
currentHoverCoverID() {
const hoverCoverMediaItem = this.productMedia.find(hoverCoverMedium =>
hoverCoverMedium.media.id === this.product.hoverCoverId
);
return hoverCoverMediaItem.id || null;
}
},
methods: {
createPlaceholderMedia(mediaItems) {
return {
...this.$super('createPlaceholderMedia'),
isHoverCover: false,
};
},
removeHoverCover() {
this.product.hoverCoverId = null;
},
isHoverCover(productMedia) {
if (this.product.media.length === 0) {
return false;
}
return productMedia.id === this.product.hoverCoverId;
},
removeFile(productMedia) {
// remove cover id if mediaId matches
if (this.product.coverId === productMedia.id) {
this.product.coverId = null;
}
// remove hover cover id if mediaId matches
if (this.product.hoverCoverId === productMedia.id) {
this.product.hoverCoverId = null;
}
this.product.media.remove(productMedia.id);
},
markMediaAsHoverCover(productMedia) {
this.product.hoverCoverId = (productMedia.productMediaId || productMedia.id);
this.productFromStore.hoverCoverId = (productMedia.productMediaId || productMedia.id);
},
}
});
{% block sw_product_media_form_grid_items %}
{% endblock %}
Hab alles mögliche schon geprüft und kann den Fehler nicht finden.