bossanova808 / CommerceRegisterOnCheckout

ARCHIVED: SEE README Allow user registration during Craft Commerce V1 checkouts.
Other
33 stars 3 forks source link

CDbException error when installing v.0.0.4 #4

Closed ax2000 closed 7 years ago

ax2000 commented 7 years ago

Hi Jeremy,

When updating to 0.0.4 I'm getting this error on installation. Tried upgrading and reinstalling but no luck.

screen shot 2017-02-21 at 1 51 16 pm

bossanova808 commented 7 years ago

Well that's just weird. Looks like the syntax for table creation and adding columns is different.

(Any reason you didn't just do an upgrade? It would have modified your original table).

In the main plugin file, can you change thuis function to this

    public function onBeforeInstall()
    {
        craft()->db->createCommand()->createTable("commerceregisteroncheckout",["orderNumber"=>"varchar","EPW"=>"varchar", "lastUsedShippingAddressId"=>"integer", "lastUsedBillingAddressId", "integer"]);        
    }

...and let me know?

Sorry! I assumed that the createTable column syntax would match the addColumnAfter syntax,

ax2000 commented 7 years ago

Thanks for the prompt reply Jeremy.

For whatever reason I uninstalled the plugin while performing tests.

I updated the onBeforeInstall function as you said but still getting this:


INT(11) NULL,
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime N' at line 6. The SQL statement executed was: CREATE TABLE `craft_commerceregisteroncheckout` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`orderNumber` VARCHAR(255) NULL,
`EPW` VARCHAR(255) NULL,
`lastUsedShippingAddressId` INT(11) NULL,
lastUsedBillingAddressId NULL,
INT(11) NULL,
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime NOT NULL,
`uid` CHAR(36) NOT NULL DEFAULT 0,
PRIMARY KEY (id)
) ENGINE=InnoDb DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci```

Not sure what's going on there
bossanova808 commented 7 years ago
    public function onBeforeInstall()
    {
        craft()->db->createCommand()->createTable("commerceregisteroncheckout",["orderNumber"=>"varchar","EPW"=>"varchar", "lastUsedShippingAddressId"=>"integer", "lastUsedBillingAddressId" => "integer"]);        
    }

Sorry, stupid syntax error there - this will work.

ax2000 commented 7 years ago

Thanks Jeremy,

That fixed the error indeed.

Unfortunately I'm getting something else now. When doing the ajax call to /actions/commerceRegisterOnCheckout/saveRegistrationDetails, I get a 500 with:



#0 /var/www/mmf-craft/craft/app/etc/errors/ErrorHandler.php(184): Craft\ErrorHandler->handleError()
#1 /var/www/mmf-craft/craft/app/framework/base/CErrorHandler.php(133): Craft\ErrorHandler->handleError()
#2 /var/www/mmf-craft/craft/app/framework/base/CApplication.php(834): Craft\ErrorHandler->handle()
#3 /var/www/mmf-craft/craft/app/etc/web/WebApp.php(687): Craft\WebApp->handleError()
#4 /var/www/mmf-craft/craft/plugins/commerceregisteroncheckout/controllers/CommerceRegisterOnCheckoutController.php(21): Craft\WebApp->handleError()
#5 /var/www/mmf-craft/craft/app/framework/web/actions/CInlineAction.php(49): Craft\CommerceRegisterOnCheckoutController->actionSaveRegistrationDetails()
#6 /var/www/mmf-craft/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams()
#7 /var/www/mmf-craft/craft/app/framework/web/CController.php(286): Craft\CommerceRegisterOnCheckoutController->runAction()
#8 /var/www/mmf-craft/craft/app/framework/web/CController.php(265): Craft\CommerceRegisterOnCheckoutController->runActionWithFilters()
#9 /var/www/mmf-craft/craft/app/framework/web/CWebApplication.php(282): Craft\CommerceRegisterOnCheckoutController->run()
#10 /var/www/mmf-craft/craft/app/etc/web/WebApp.php(817): Craft\WebApp->runController()
#11 /var/www/mmf-craft/craft/app/etc/web/WebApp.php(287): Craft\WebApp->_processActionRequest()
#12 /var/www/mmf-craft/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
#13 /var/www/mmf-craft/craft/app/index.php(62): Craft\WebApp->run()
#14 /var/www/mmf-craft/public/index.php(19): require_once()```
ax2000 commented 7 years ago

Nevermind Jeremy.

I'm pretty sure this is something on my end. Please let me check a couple of more things and I'll get back to you

bossanova808 commented 7 years ago

Sure - yes that looks like something else. I'll jstu wait for you to confirm then push the fix. Still find it wierd that two basically the same things use different syntax, but there you go...

bossanova808 commented 7 years ago

I pushed this out as I don't want anyone else to get stuck with an upgrade...