Archive::build() must have the same parameters order as all the API calls that use idSite, Period, Date.
fixed in 
mikael thanks the only thing is that in your patch you're using an absolute path D:/project/piwik etc. it makes it impossible to apply your patch directly. you should instead have a relative path /modules/Archive.php etc.