You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prestashop version: 8.1.3 but I think it's unrelated to Prestashop version
Trying to add a manufacturer using either Add or AddAsync methods throws an exception at line 186 (using AddAsync) or at line 46 (using Add) in GenericFactory.cs:
Exception has occurred: CLR/System.InvalidOperationException
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Private.CoreLib.dll: 'Nullable object must have a value.'
In order to reproduce:
Clone the GitHub repo
Add a new console project to the solution
Add PrestaSharp ass a reference to the project
In Program.cs:
using Bukimedia.PrestaSharp.Entities;using Bukimedia.PrestaSharp.Factories;stringurl="http://localhost/prestashop/api";stringaccount="<api_key>";stringsecretKey="";stringmanufacturerName="TestManufacturer";ManufacturerFactorymanufacturerFactory=new ManufacturerFactory(url, account, secretKey);// just to test that credentials are correctList<manufacturer>manufacturers= manufacturerFactory.GetAll();varnewManufacturer=new manufacturer();
newManufacturer.name =manufacturerName;
newManufacturer.active =1;newManufacturer= manufacturerFactory.Add(newManufacturer);// ornewManufacturer=await manufacturerFactory.AddAsync(newManufacturer);
Looking at the AddBody method (that was change in pull request 469) in RestSharpFactory.cs I can see that entities is not used and serialized is just an empty string:
Prestashop version: 8.1.3 but I think it's unrelated to Prestashop version
Trying to add a manufacturer using either Add or AddAsync methods throws an exception at line 186 (using AddAsync) or at line 46 (using Add) in GenericFactory.cs:
In order to reproduce:
Reverting back before Merge pull request #469 fixes the issue:
git reset 0121cc0 --hard
Looking at the AddBody method (that was change in pull request 469) in RestSharpFactory.cs I can see that
entities
is not used andserialized
is just an empty string:The text was updated successfully, but these errors were encountered: