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

Switching a field type from Checkbox to Lightswitch causes MySQL error about data truncation #1

Closed
angrybrad opened this issue Jan 27, 2017 · 1 comment
Labels
bug mysql severity:minor Cosmetic issues or bugs with simple workarounds

Comments

@angrybrad
Copy link
Member

angrybrad commented Jan 27, 2017

Environment:

  • Craft version: 3.x
  • PHP version: 7.x
  • Database driver & version: MySQL - Need to verify behavior in PostgreSQL
  • Plugins & versions:

Description:

Switching a field type from Checkbox to Lightswitch causes MySQL error about data truncation.

Steps to reproduce:

Change a field with data in it from a Checkbox to a Lightswitch.

@angrybrad
Copy link
Member Author

Maybe come up with a way for field types to be notified when their type changes. Also maybe a the concept of "convertible/compatible" data types for field types when changing.

@angrybrad angrybrad added bug mysql severity:normal Bugs that affect typical usage labels Jan 27, 2017
@brandonkelly brandonkelly added severity:minor Cosmetic issues or bugs with simple workarounds and removed severity:normal Bugs that affect typical usage labels Feb 3, 2017
leevigraham referenced this issue in leevigraham/cms Jun 1, 2017
This fixes an issue where changing the entryType of an existing entry triggers a 500 error:

PHP Notice 'yii\base\ErrorException' with message 'Undefined index: entryId' 

in /Volumes/Sites/Personal/craft3/vendor/craftcms/cms/src/controllers/EntriesController.php:773

Stack trace:
#0 … vendor/yiisoft/yii2/base/InlineAction.php(57): craft\controllers\EntriesController->actionSwitchEntryType()
#1 … vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/Volumes/Sites/Personal/craft3/vendor/yiisoft/yii2/base/InlineAction.php:57}('???', '???')
#2 … vendor/yiisoft/yii2/base/Controller.php(156): yii\base\InlineAction->runWithParams('???')
craftcms#3 … vendor/yiisoft/yii2/base/Module.php(523): yii\base\Controller->runAction('???', '???')
craftcms#4 … vendor/craftcms/cms/src/web/Application.php(246): yii\base\Module->runAction('???', '???')
craftcms#5 … vendor/craftcms/cms/src/web/Application.php(385): craft\web\Application->runAction('???', '???')
craftcms#6 … vendor/craftcms/cms/src/web/Application.php(206): craft\web\Application->_processActionRequest('???')
craftcms#7 … vendor/yiisoft/yii2/base/Application.php(380): craft\web\Application->handleRequest('???')
craftcms#8 … web/index.php(33): yii\base\Application->run()
craftcms#9 {main}
brandonkelly pushed a commit that referenced this issue Jun 1, 2017
This fixes an issue where changing the entryType of an existing entry triggers a 500 error:

PHP Notice 'yii\base\ErrorException' with message 'Undefined index: entryId' 

in /Volumes/Sites/Personal/craft3/vendor/craftcms/cms/src/controllers/EntriesController.php:773

Stack trace:
#0 … vendor/yiisoft/yii2/base/InlineAction.php(57): craft\controllers\EntriesController->actionSwitchEntryType()
#1 … vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/Volumes/Sites/Personal/craft3/vendor/yiisoft/yii2/base/InlineAction.php:57}('???', '???')
#2 … vendor/yiisoft/yii2/base/Controller.php(156): yii\base\InlineAction->runWithParams('???')
#3 … vendor/yiisoft/yii2/base/Module.php(523): yii\base\Controller->runAction('???', '???')
#4 … vendor/craftcms/cms/src/web/Application.php(246): yii\base\Module->runAction('???', '???')
#5 … vendor/craftcms/cms/src/web/Application.php(385): craft\web\Application->runAction('???', '???')
#6 … vendor/craftcms/cms/src/web/Application.php(206): craft\web\Application->_processActionRequest('???')
#7 … vendor/yiisoft/yii2/base/Application.php(380): craft\web\Application->handleRequest('???')
#8 … web/index.php(33): yii\base\Application->run()
#9 {main}
brandonkelly pushed a commit that referenced this issue Sep 11, 2017
angrybrad pushed a commit that referenced this issue Oct 4, 2017
timkelty added a commit that referenced this issue Feb 23, 2024
file_exists(): Passing null to parameter #1 ($filename) of type string is deprecated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mysql severity:minor Cosmetic issues or bugs with simple workarounds
Projects
None yet
Development

No branches or pull requests

2 participants