Closed LukeKB closed 7 years ago
I'm getting this error when trying to save changes from the Manage Menu Groups page form.
Sprout\Exceptions\ConstraintQueryException /Users/Pearly/Documents/SVN/sprout3/src/sprout/Helpers/Pdb.php [421]: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (sprout3.sprout_menu_extras, CONSTRAINT sprout_menu_extras_ibfk_1 FOREIGN KEY (image) REFERENCES sprout_files (id) ON UPDATE >CASCADE) Log ID 348 Stack Trace /Users/Pearly/Documents/SVN/sprout3/src/sprout/Helpers/Pdb.php [567]: Sprout\Helpers\Pdb::createQueryException( PDOException ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/Helpers/Pdb.php [440]: Sprout\Helpers\Pdb::query( 'INSERT INTO ~menu_extras (subsite_id, page_id, image) VALUES (:subsite_id, :page_id, :image)', array(3): >[':subsite_id' => 1, ':page_id' => 2, ':image' => ''], 'count' ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/Helpers/Pdb.php [888]: Sprout\Helpers\Pdb::q( 'INSERT INTO ~menu_extras (subsite_id, page_id, image) VALUES (:subsite_id, :page_id, :image)', array(3): >[':subsite_id' => 1, ':page_id' => 2, ':image' => ''], 'count' ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/Controllers/Admin/PageAdminController.php [1837]: Sprout\Helpers\Pdb::insert( 'menu_extras', array(3): ['subsite_id' => 1, 'page_id' => 2, 'image' => ''] ) Sprout\Controllers\Admin\PageAdminController->menuGroupsAction( ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/Controllers/AdminController.php [1944]: call_user_func_array( array(2): [Sprout\Controllers\Admin\PageAdminController, 'menuGroupsAction'], array(0): [] ) Sprout\Controllers\AdminController->call( 'page', 'menuGroupsAction' ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/core/Kohana.php [266]: ReflectionMethod->invokeArgs( Sprout\Controllers\AdminController, array(2): ['page', 'menuGroupsAction'] ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/core/Bootstrap.php [103]: Kohana::instance( ) /Users/Pearly/Documents/SVN/sprout3/src/index.php [117]: require( '/Users/Pearly/Documents/SVN/sprout3/src/sprout/core/Bootstrap.php' )
Sprout\Exceptions\ConstraintQueryException
/Users/Pearly/Documents/SVN/sprout3/src/sprout/Helpers/Pdb.php [421]: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (sprout3.sprout_menu_extras, CONSTRAINT sprout_menu_extras_ibfk_1 FOREIGN KEY (image) REFERENCES sprout_files (id) ON UPDATE >CASCADE) Log ID 348 Stack Trace
sprout3
sprout_menu_extras
sprout_menu_extras_ibfk_1
image
sprout_files
id
/Users/Pearly/Documents/SVN/sprout3/src/sprout/Helpers/Pdb.php [567]: Sprout\Helpers\Pdb::createQueryException( PDOException ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/Helpers/Pdb.php [440]: Sprout\Helpers\Pdb::query( 'INSERT INTO ~menu_extras (subsite_id, page_id, image) VALUES (:subsite_id, :page_id, :image)', array(3): >[':subsite_id' => 1, ':page_id' => 2, ':image' => ''], 'count' ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/Helpers/Pdb.php [888]: Sprout\Helpers\Pdb::q( 'INSERT INTO ~menu_extras (subsite_id, page_id, image) VALUES (:subsite_id, :page_id, :image)', array(3): >[':subsite_id' => 1, ':page_id' => 2, ':image' => ''], 'count' ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/Controllers/Admin/PageAdminController.php [1837]: Sprout\Helpers\Pdb::insert( 'menu_extras', array(3): ['subsite_id' => 1, 'page_id' => 2, 'image' => ''] ) Sprout\Controllers\Admin\PageAdminController->menuGroupsAction( ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/Controllers/AdminController.php [1944]: call_user_func_array( array(2): [Sprout\Controllers\Admin\PageAdminController, 'menuGroupsAction'], array(0): [] ) Sprout\Controllers\AdminController->call( 'page', 'menuGroupsAction' ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/core/Kohana.php [266]: ReflectionMethod->invokeArgs( Sprout\Controllers\AdminController, array(2): ['page', 'menuGroupsAction'] ) /Users/Pearly/Documents/SVN/sprout3/src/sprout/core/Bootstrap.php [103]: Kohana::instance( ) /Users/Pearly/Documents/SVN/sprout3/src/index.php [117]: require( '/Users/Pearly/Documents/SVN/sprout3/src/sprout/core/Bootstrap.php' )
Fixed by 097488f; also see 4429037 and 86cdeb9
I'm getting this error when trying to save changes from the Manage Menu Groups page form.