Database Error
Error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'
SQL Query:
INSERT INTO `mcac_churchie`.`posts` (`slug`, `modified`, `created`) VALUES ('', '2012-05-19 18:02:26', '2012-05-19 18:02:26')
Notice:
If you want to customize this error message, create app/View/Errors/pdo_error.ctp
Stack Trace
- CORE/Cake/Model/Datasource/DboSource.php line 437 → PDOStatement->execute(array)
try {
$query = $this->_connection->prepare($sql, $prepareOptions);
$query->setFetchMode(PDO::FETCH_LAZY);
if (!$query->execute($params)) {
$this->_results = $query;
- CORE/Cake/Model/Datasource/DboSource.php line 403 → DboSource->_execute(string, array)
$options += array('log' => $this->fullDebug);
$t = microtime(true);
$this->_result = $this->_execute($sql, $params);
'INSERT INTO `mcac_churchie`.`posts` (`slug`, `modified`, `created`) VALUES ('', '2012-05-19 18:02:26', '2012-05-19 18:02:26')'
array()
- CORE/Cake/Model/Datasource/DboSource.php line 985 → DboSource->execute(string)
'values' => implode(', ', $valueInsert)
);
if ($this->execute($this->renderStatement('create', $query))) {
if (empty($id)) {
'INSERT INTO `mcac_churchie`.`posts` (`slug`, `modified`, `created`) VALUES ('', '2012-05-19 18:02:26', '2012-05-19 18:02:26')'
- CORE/Cake/Model/Model.php line 1705 → DboSource->create(Post, array, array)
}
}
if (!$db->create($this, $fields, $values)) {
$success = $created = false;
object(Post) {
name => 'Post'
displayField => 'title'
validate => array(
)
belongsTo => array(
)
hasMany => array(
)
components => array(
)
useDbConfig => 'default'
useTable => 'posts'
id => false
data => array(
)
schemaName => 'mcac_churchie'
table => 'posts'
primaryKey => 'id'
validationErrors => array()
validationDomain => null
alias => 'Post'
tableToModel => array(
)
cacheQueries => false
hasOne => array()
hasAndBelongsToMany => array()
actsAs => null
Behaviors => object(BehaviorCollection) {}
whitelist => array(
)
cacheSources => true
findQueryType => null
recursive => (int) 1
order => null
virtualFields => array()
__backAssociation => array()
__backInnerAssociation => array()
__backOriginalAssociation => array()
__backContainableAssociation => array()
findMethods => array(
)
tablePrefix => ''
Group => object(Group) {}
User => object(User) {}
Attachment => object(AppModel) {}
}
array(
(int) 0 => 'slug',
(int) 1 => 'modified',
(int) 2 => 'created'
)
array(
(int) 0 => '',
(int) 1 => '2012-05-19 18:02:26',
(int) 2 => '2012-05-19 18:02:26'
)
- CORE/Cake/Model/Model.php line 1557 → Model->save(array, array)
} else {
$options = array('validate' => $validate, 'fieldList' => array($name));
}
return $this->save(array($this->alias => array($this->primaryKey => $id, $name => $value)), $options);
}
array(
'Post' => array(
)
)
array(
'validate' => false,
'fieldList' => array(
)
)
- APP/Plugin/UrgPost/Controller/PostsController.php line 73 → Model->saveField(string, string)
$slug = strtolower(Inflector::slug(str_replace("'", "", $post["Post"]["title"]), "-"));
$this->log("Post to create slug for ($id): " . Debugger::exportVar($post, 3), LOG_DEBUG);
$this->log("Saving slug as: " . $slug, LOG_DEBUG);
$this->Post->saveField("slug", $slug);
}
- [internal function] → PostsController->view(string, string)
- CORE/Cake/Controller/Controller.php line 485 → ReflectionMethod->invokeArgs(PostsController, array)
'action' => $request->params['action']
));
}
return $method->invokeArgs($this, $request->params['pass']);
object(PostsController) {
name => 'Posts'
AUDIO_WEBROOT => 'audio'
IMAGES_WEBROOT => 'img'
FILES_WEBROOT => 'files'
AUDIO => '/app/Plugin/UrgPost/webroot/audio'
IMAGES => '/app/Plugin/UrgPost/webroot/img'
FILES => '/app/Plugin/UrgPost/webroot/files'
WEBROOT => '/app/Plugin/UrgPost/webroot'
BANNER_SIZE => (int) 700
PANEL_BANNER_SIZE => (int) 460
components => array(
)
helpers => array(
)
uses => array(
)
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Posts'
layoutPath => null
viewVars => array()
view => 'view'
layout => 'default'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
viewClass => 'View'
View => null
ext => '.ctp'
plugin => 'UrgPost'
cacheAction => false
passedArgs => array(
)
scaffold => false
methods => array(
)
modelClass => 'Post'
modelKey => 'post'
validationErrors => null
Session => object(SessionComponent) {}
Urg => object(UrgComponent) {}
Auth => object(AuthComponent) {}
Poster => object(PosterComponent) {}
Cuploadify => object(CuploadifyComponent) {}
ImgLib => object(ImgLibComponent) {}
WidgetUtil => object(WidgetUtilComponent) {}
FlyLoader => object(FlyLoaderComponent) {}
GroupTitle => object(GroupTitleComponent) {}
Post => object(Post) {}
}
array(
(int) 0 => '236',
(int) 1 => 'visiting-mcac'
)
- CORE/Cake/Routing/Dispatcher.php line 103 → Controller->invokeAction(CakeRequest)
$controller->startupProcess();
$render = true;
$result = $controller->invokeAction($request);
if ($result instanceof CakeResponse) {
object(CakeRequest) {
params => array(
)
data => array()
query => array()
url => 'posts/view/236/visiting-mcac'
base => ''
webroot => '/'
here => '/posts/view/236/visiting-mcac'
}
- CORE/Cake/Routing/Dispatcher.php line 85 → Dispatcher->_invoke(PostsController, CakeRequest, CakeResponse)
));
}
return $this->_invoke($controller, $request, $response);
}
object(PostsController) {
name => 'Posts'
AUDIO_WEBROOT => 'audio'
IMAGES_WEBROOT => 'img'
FILES_WEBROOT => 'files'
AUDIO => '/app/Plugin/UrgPost/webroot/audio'
IMAGES => '/app/Plugin/UrgPost/webroot/img'
FILES => '/app/Plugin/UrgPost/webroot/files'
WEBROOT => '/app/Plugin/UrgPost/webroot'
BANNER_SIZE => (int) 700
PANEL_BANNER_SIZE => (int) 460
components => array(
)
helpers => array(
)
uses => array(
)
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Posts'
layoutPath => null
viewVars => array()
view => 'view'
layout => 'default'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
viewClass => 'View'
View => null
ext => '.ctp'
plugin => 'UrgPost'
cacheAction => false
passedArgs => array(
)
scaffold => false
methods => array(
)
modelClass => 'Post'
modelKey => 'post'
validationErrors => null
Session => object(SessionComponent) {}
Urg => object(UrgComponent) {}
Auth => object(AuthComponent) {}
Poster => object(PosterComponent) {}
Cuploadify => object(CuploadifyComponent) {}
ImgLib => object(ImgLibComponent) {}
WidgetUtil => object(WidgetUtilComponent) {}
FlyLoader => object(FlyLoaderComponent) {}
GroupTitle => object(GroupTitleComponent) {}
Post => object(Post) {}
}
object(CakeRequest) {
params => array(
)
data => array()
query => array()
url => 'posts/view/236/visiting-mcac'
base => ''
webroot => '/'
here => '/posts/view/236/visiting-mcac'
}
object(CakeResponse) {
}
- APP/webroot/index.php line 96 → Dispatcher->dispatch(CakeRequest, CakeResponse)
App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
object(CakeRequest) {
params => array(
)
data => array()
query => array()
url => 'posts/view/236/visiting-mcac'
base => ''
webroot => '/'
here => '/posts/view/236/visiting-mcac'
}
object(CakeResponse) {
}