kiwicommerce/magento2-customer-password

M2.3 support

Closed this issue · 1 comments

Hey KiwiCommerce, I just tried installing this on M2.3.1 and had a wee bit of trouble with an error Uncaught TypeError: Return value of Magento\Framework\Setup\Declaration\Schema\Declaration\SchemaBuilder::processTable() must be an instance of Magento\Framework\Setup\Declaration\Schema\Dto\Table. Changing the setAreaCode() on the console command appeared to fix this. Alan Storm's blog on the area code subject has an interesting note (due to an edit) at the bottom about how it's not great to set the area code in the constructor and instead should be set in the execute() method of a command: https://alanstorm.com/magento-2-fixing-area-code-not-set-exceptions/. It appears that there was a call to setAreaCode() which was commented out in the execute() method.

I've attached a patch for the changes I made to get past that and get the install completed. Things have been going ok with initial testing afterwards (created customer, set a new password for customer, disabled module, no more set password option, enabled module, setting new password works correctly, see stuff in log, etc).

Patch is at https://gist.github.com/jaminion/a97a5a6d1e2ca5243af68e4a43c0bdc7. Also it appears that the getAreaCode() can throw an exception, but it might be important to do the checking anyway in case the command is called by another command or cron task or something.

Last but not least it appears that the php bin/magento setup:install --convert-old-scripts=1 successfully creates what appears to be a useful etc/db_schema.xml file.

Thank you very much for making this module available, it appears to be extremely useful and well-designed.

Hi @jaminion . Thank you for your report.
The issue has been fixed
Related commit(s):

The fix will be available with the upcoming release.