Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with Sprout Forms plugin #7

Closed
superwick opened this issue Dec 15, 2016 · 2 comments
Closed

Conflict with Sprout Forms plugin #7

superwick opened this issue Dec 15, 2016 · 2 comments

Comments

@superwick
Copy link

When the Locale Sync plugin is enabled, and Sprout Forms is enabled, Locale Sync will cause an error when trying to create a new Sprout Form and change the default form handle.

2016/12/15 14:37:14 [error] [system.db.CDbCommand] CDbCommand::fetch() failed: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'klipsch_staging.craft_sproutformscontent_form1' doesn't exist. The SQL statement executed was: SELECT *
FROM `craft_sproutformscontent_form1`
WHERE (`elementId`=:pnlimW2ymc) AND (`locale`=:psNN739cdI).
2016/12/15 14:37:14 [error] [exception.CDbException] CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'klipsch_staging.craft_sproutformscontent_form1' doesn't exist in /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/framework/db/CDbCommand.php:543
Stack trace:
#0 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/framework/db/CDbCommand.php(415): CDbCommand->queryInternal('fetch', Array, Array)
#1 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/services/ContentService.php(65): CDbCommand->queryRow()
#2 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/models/BaseElementModel.php(815): Craft\ContentService->getContent(Object(Craft\SproutForms_FormModel))
#3 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/framework/base/CComponent.php(111): Craft\BaseElementModel->getContent()
#4 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/models/BaseModel.php(87): CComponent->__get('content')
#5 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/models/BaseElementModel.php(141): Craft\BaseModel->__get('content')
#6 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/plugins/localesync/services/LocaleSyncService.php(121): Craft\BaseElementModel->__get('content')
#7 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/plugins/localesync/services/LocaleSyncService.php(93): Craft\LocaleSyncService->updateElement(Object(Craft\SproutForms_FormModel), 'title')
#8 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/plugins/localesync/LocaleSyncPlugin.php(28): Craft\LocaleSyncService->syncElementContent(Object(Craft\Event), NULL)
#9 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/framework/base/CComponent.php(567): Craft\LocaleSyncPlugin->Craft\{closure}(Object(Craft\Event))
#10 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/services/ElementsService.php(2359): CComponent->raiseEvent('onbeforesaveele...', Object(Craft\Event))
#11 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/services/ElementsService.php(1380): Craft\ElementsService->onBeforeSaveElement(Object(Craft\Event))
#12 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/plugins/sproutforms/services/SproutForms_FormsService.php(172): Craft\ElementsService->saveElement(Object(Craft\SproutForms_FormModel))
#13 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/plugins/sproutforms/controllers/SproutForms_FormsController.php(106): Craft\SproutForms_FormsService->saveForm(Object(Craft\SproutForms_FormModel))
#14 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/framework/web/actions/CInlineAction.php(49): Craft\SproutForms_FormsController->actionSaveForm()
#15 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#16 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))
#17 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#18 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/framework/web/CWebApplication.php(282): CController->run('saveForm')
#19 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/etc/web/WebApp.php(817): CWebApplication->runController('sproutForms/for...')
#20 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/etc/web/WebApp.php(287): Craft\WebApp->_processActionRequest()
#21 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
#22 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/craft/app/index.php(62): CApplication->run()
#23 /mnt/klipschweb-data-prod1/www/klipsch-staging/app/public_staged/index.php(19): require_once('/mnt/klipschweb...')
#24 {main}
REQUEST_URI=/admin/sproutforms/forms/edit/46798
HTTP_REFERER=http://staging.klipsch.com/admin/sproutforms/forms/edit/46798

I was able to get around this with a null check in the Craft\LocaleSyncService->syncElementContent method. Will post a PR soon.

@timkelty
Copy link
Owner

Yikes! Thanks for the issue. I'll be looking for your PR.

@timkelty
Copy link
Owner

timkelty commented Nov 9, 2017

@superwick finally got around to testing this.

I'm not seeing this with the latest Sprout Forms (2.5.5).
I also added a condition to bail out early if the element doesn't have more than 1 locale, so could help too if it is still happening for some reason.

Please try with the latest of both plugins and let me know if it isn't fixed.

@timkelty timkelty closed this as completed Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants