Quantcast
Channel: Programmierung - Shopware Community Forum
Viewing all articles
Browse latest Browse all 2871

Rest-API bringt Fehlermeldung bei Artikel anlegen sobald ein Bild mitgeliefert wird (5.2.3)

$
0
0

Hallo allerseits !!

Wenn ich über die REST-API einen Artikel ohne Bild anlege funktioniert das einwandfrei.

Wenn ich ein Image mitgeben möchte bekomme ich folgende Fehlermeldung.

 

Auszug aus dem C#-Source

 

public class SW_Articles_Image2

{

        public int id { get; set; }

        public string link { get; set; }

        public string description { get; set; }

        public string path { get; set; }

        public int main { get; set; }

        public int position { get; set; }

        public int width { get; set; }

        public int height { get; set; }

        public string relations { get; set; }

        public string extension { get; set; }

        public int mediaId { get; set; }

}

 

article.images = new List<SW_Articles_Image2> { };

image = new SW_Articles_Image2();

image.description = "Neues Bild";

image.link = "/server/bilder/30829.jpg";

article.images.Add(image);

 

\\Shopware\\Models\\Article\\Image by id 0 not found

 

Eigentlich sollte der POST selbst dem Bild eine ID vergeben und die Daten in s_articles_img speichern.

Was mache ich falsch ?

 

 


Viewing all articles
Browse latest Browse all 2871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>