markshust / magento2-module-simpledata

The SimpleData module simplifies calling Magento data structures.
MIT License
94 stars 7 forks source link

Does not work in production mode #4

Closed wigman closed 3 years ago

wigman commented 3 years ago

Hi Mark,

First of all thanks for building yet another great OS tool.

Unfortunately, using the class_alias on the WriterInterface does not work with expected types in DI when you enable production mode. > https://github.com/markshust/magento2-module-simpledata/blob/master/Api/Config/SimpleConfig.php#L9

Is it supposed to work in production?

Here's the error for reference:

[latest] < In AbstractFactory.php line 131:
[latest] <                                                                                
[latest] <   Type Error occurred when creating object: [NAMESPACE]\Cms\Setup\Patch\Data\Cre  
[latest] <   ateSomeBlock, Argument 2 passed to MarkShust\SimpleData\Setup\Patch\  
[latest] <   SimpleDataPatch::__construct() must be an instance of MarkShust\SimpleData\  
[latest] <   Api\Config\SimpleConfig, instance of Magento\Framework\App\Config\Storage\W  
[latest] <   riter given, called in [PATH]/src/vendor/magento/framework/ObjectManager/Factory/AbstractFact  
[latest] <   ory.php on line 121

Cheers!

markshust commented 3 years ago

Thanks @wigman. I haven't tested on prod, but your report makes sense. I'll take a look at this shortly, but open for a PR to fix it.

wigman commented 3 years ago

Thanks! We opted to do it without the module for now, since we were in a bit of a hurry. Next time we'd need it we could def. create a PR if it's not already changed by then.

markshust commented 3 years ago

Merged fix, I'll be making a few more updates and tagging the update on 2.0.0.

markshust commented 3 years ago

Released 2.0.0 https://github.com/markshust/magento2-module-simpledata/blob/master/CHANGELOG.md#200---2020-01-12