willpublicmedia / npr-api-expressionengine

Access the NPR API from within ExpressionEngine.
1 stars 1 forks source link

Duplicate key exception on reinstall #12

Closed areynold closed 4 years ago

areynold commented 4 years ago

In GitLab by @areynold on Jul 30, 2019, 10:50

The field installer seems to be duplicating a field:


Exception Caught
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '18-6' for key 'PRIMARY':
INSERT INTO `exp_channel_field_groups_fields` (`group_id`, `field_id`) VALUES (6, 18)

ee/legacy/database/drivers/mysqli/mysqli_connection.php:117
Stack Trace: Please include when reporting this error

    #0 system\ee\legacy\database\drivers\mysqli\mysqli_driver.php(112): CI_DB_mysqli_connection->query('INSERT INTO `ex...')
    #1 system\ee\legacy\database\DB_driver.php(270): CI_DB_mysqli_driver->_execute('INSERT INTO `ex...')
    #2 system\ee\legacy\database\DB_driver.php(180): CI_DB_driver->simple_query('INSERT INTO `ex...')
    #3 system\ee\legacy\database\DB_active_rec.php(1371): CI_DB_driver->query('INSERT INTO `ex...')
    #4 system\ee\EllisLab\ExpressionEngine\Service\Model\Relation\HasAndBelongsToMany.php(120): CI_DB_active_record->insert('channel_field_g...')
    #5 system\ee\EllisLab\ExpressionEngine\Service\Model\Association\Diff.php(99): EllisLab\ExpressionEngine\Service\Model\Relation\HasAndBelongsToMany->insert(Object(EllisLab\ExpressionEngine\Model\Channel\ChannelFieldGroup), Array)
    #6 system\ee\EllisLab\ExpressionEngine\Service\Model\Association\Association.php(216): EllisLab\ExpressionEngine\Service\Model\Association\Diff->commit()
    #7 system\ee\EllisLab\ExpressionEngine\Service\Model\Model.php(369): EllisLab\ExpressionEngine\Service\Model\Association\Association->save()
    #8 system\user\addons\npr_story_api\libraries\installation\field_installer.php(98): EllisLab\ExpressionEngine\Service\Model\Model->save()
    #9 system\user\addons\npr_story_api\libraries\installation\field_installer.php(68): IllinoisPublicMedia\NprStoryApi\Libraries\Installation\Field_installer->create_field(Array)
    #10 system\user\addons\npr_story_api\upd.npr_story_api.php(150): IllinoisPublicMedia\NprStoryApi\Libraries\Installation\Field_installer->install()
    #11 system\user\addons\npr_story_api\upd.npr_story_api.php(72): Npr_story_api_upd->create_required_fields()
    #12 system\ee\legacy\libraries\addons\Addons_installer.php(68): Npr_story_api_upd->install()
    #13 system\ee\legacy\libraries\addons\Addons_installer.php(386): Addons_installer->install_module('npr_story_api')
    #14 system\ee\legacy\libraries\addons\Addons_installer.php(35): Addons_installer->_update_addon('npr_story_api', 'module', 'install', false)
    #15 system\ee\EllisLab\ExpressionEngine\Controller\Addons\Addons.php(1503): Addons_installer->install('npr_story_api', 'module', false)
    #16 system\ee\EllisLab\ExpressionEngine\Controller\Addons\Addons.php(737): EllisLab\ExpressionEngine\Controller\Addons\Addons->installModule('npr_story_api')
    #17 [internal function]: EllisLab\ExpressionEngine\Controller\Addons\Addons->install(Array)
    #18 system\ee\EllisLab\ExpressionEngine\Core\Core.php(241): call_user_func_array(Array, Array)
    #19 system\ee\EllisLab\ExpressionEngine\Core\Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
    #20 system\ee\EllisLab\ExpressionEngine\Boot\boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
    #21 admin.php(153): require_once('C:\\Bitnami\\wamp...')
    #21 admin.php(153): require_once('C:\\Bitnami\\wamp...') 
areynold commented 4 years ago

In GitLab by @areynold on Jul 30, 2019, 10:56

closed