@@ -576,7 +576,15 @@ public function getErrorAggregator()
576
576
*/
577
577
public function uploadSource ()
578
578
{
579
- return $ this ->upload ->uploadSource ($ this );
579
+ $ result = $ this ->upload ->uploadSource ($ this );
580
+ $ entity = $ this ->getEntity ();
581
+ // phpcs:ignore Magento2.Functions.DiscouragedFunction
582
+ $ extension = pathinfo ($ result ['file ' ], PATHINFO_EXTENSION );
583
+ $ sourceFile = $ this ->getWorkingDir () . $ entity . '. ' . $ extension ;
584
+ $ sourceFileRelative = $ this ->getVarDirectory ()->getRelativePath ($ sourceFile );
585
+ $ this ->_removeBom ($ sourceFile );
586
+ $ this ->createHistoryReport ($ sourceFileRelative , $ entity , $ extension , $ result );
587
+ return $ sourceFile ;
580
588
}
581
589
582
590
/**
@@ -626,7 +634,7 @@ public function getVarDirectory()
626
634
* @return $this
627
635
* @throws FileSystemException
628
636
*/
629
- public function _removeBom ($ sourceFile )
637
+ protected function _removeBom ($ sourceFile )
630
638
{
631
639
$ driver = $ this ->_varDirectory ->getDriver ();
632
640
$ string = $ driver ->fileGetContents ($ this ->_varDirectory ->getAbsolutePath ($ sourceFile ));
@@ -809,7 +817,7 @@ public function isReportEntityType($entity = null)
809
817
* @return $this
810
818
* @throws LocalizedException
811
819
*/
812
- public function createHistoryReport ($ sourceFileRelative , $ entity , $ extension = null , $ result = null )
820
+ protected function createHistoryReport ($ sourceFileRelative , $ entity , $ extension = null , $ result = null )
813
821
{
814
822
if ($ this ->isReportEntityType ($ entity )) {
815
823
if (is_array ($ sourceFileRelative )) {
0 commit comments