Notice (8) : Undefined index: Info [APP\Controller\MainController.php , line 691 ]Code Context $this -> set (array( 'news' => $news ));
$CountRead = $news [ 'Info' ][ 'CountRead' ] + 1 ;
$id = '59303905'
$news = array() MainController::InfoActivityDetail() - APP\Controller\MainController.php, line 691
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - CORE\Cake\Controller\Controller.php, line 490
Dispatcher::_invoke() - CORE\Cake\Routing\Dispatcher.php, line 191
Dispatcher::dispatch() - CORE\Cake\Routing\Dispatcher.php, line 165
[main] - APP\webroot\index.php, line 108
AGTRACE CMU,Faculty of Agriculture Chiangmai University
Database Error
Error:
SQLSTATE[HY000]: General error: 1364 Field 'Title' doesn't have a default value
SQL Query:
INSERT INTO `agtrust`.`infos` (`id`, `CountRead`, `modified`, `created`) VALUES (59303905, 1, '2024-03-29 07:18:58', '2024-03-29 07:18:58')
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 458 → 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 424 → DboSource->_execute(string, array) $options += array( 'log' => $this -> fullDebug );
$t = microtime ( true );
$this -> _result = $this -> _execute ( $sql , $params );
'INSERT INTO `agtrust`.`infos` (`id`, `CountRead`, `modified`, `created`) VALUES (59303905, 1, '2024-03-29 07:18:58', '2024-03-29 07:18:58')'
array()
CORE\Cake\Model\Datasource\DboSource.php line 1012 → DboSource->execute(string) 'values' => implode ( ', ' , $valueInsert )
);
if ( $this -> execute ( $this -> renderStatement ( 'create' , $query ))) {
if (empty( $id )) {
'INSERT INTO `agtrust`.`infos` (`id`, `CountRead`, `modified`, `created`) VALUES (59303905, 1, '2024-03-29 07:18:58', '2024-03-29 07:18:58')'
CORE\Cake\Model\Model.php line 1850 → DboSource->create(Info, array, array) }
}
if (! $db -> create ( $this , $fields , $values )) {
$success = false ;
object(Info) {
useDbConfig => 'agtrust'
belongsTo => array(
[maximum depth reached]
)
hasMany => array(
[maximum depth reached]
)
useTable => 'infos'
id => false
data => array(
[maximum depth reached]
)
schemaName => 'agtrust'
table => 'infos'
primaryKey => 'id'
validate => array([maximum depth reached])
validationErrors => array([maximum depth reached])
validationDomain => null
tablePrefix => ''
plugin => null
name => 'Info'
alias => 'Info'
tableToModel => array(
[maximum depth reached]
)
cacheQueries => false
hasOne => array([maximum depth reached])
hasAndBelongsToMany => array([maximum depth reached])
actsAs => null
Behaviors => object(BehaviorCollection) {}
whitelist => array([maximum depth reached])
cacheSources => true
findQueryType => null
recursive => (int) 1
order => null
virtualFields => array([maximum depth reached])
__backAssociation => array([maximum depth reached])
__backInnerAssociation => array([maximum depth reached])
__backOriginalAssociation => array([maximum depth reached])
__backContainableAssociation => array([maximum depth reached])
__safeUpdateMode => false
findMethods => array(
[maximum depth reached]
)
Typenew => object(Typenew) {}
InfoDocument => object(InfoDocument) {}
[protected] _schema => array(
[maximum depth reached]
)
[protected] _associationKeys => array(
[maximum depth reached]
)
[protected] _associations => array(
[maximum depth reached]
)
[protected] _insertID => null
[protected] _sourceConfigured => true
[protected] _eventManager => object(CakeEventManager) {}
[protected] _validator => object(ModelValidator) {}
}
array(
(int) 0 => 'id',
(int) 1 => 'CountRead',
(int) 2 => 'modified',
(int) 3 => 'created'
)
array(
(int) 0 => '59303905',
(int) 1 => (int) 1,
(int) 2 => '2024-03-29 07:18:58',
(int) 3 => '2024-03-29 07:18:58'
)
APP\Controller\MainController.php line 693 → Model->save(array)
$CountRead = $news [ 'Info' ][ 'CountRead' ] + 1 ;
$data = array( 'id' => $id , 'CountRead' => $CountRead );
$this -> Info -> save ( $data );
//==================================
array(
'id' => '59303905',
'CountRead' => (int) 1
)
[internal function] → MainController->InfoActivityDetail(string)
CORE\Cake\Controller\Controller.php line 490 → ReflectionMethod->invokeArgs(MainController, array) 'action' => $request -> params [ 'action' ]
));
}
return $method -> invokeArgs ( $this , $request -> params [ 'pass' ]);
object(MainController) {
paginate => array(
[maximum depth reached]
)
uses => array(
[maximum depth reached]
)
name => 'Main'
helpers => array([maximum depth reached])
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Main'
layoutPath => null
viewVars => array(
[maximum depth reached]
)
view => 'InfoActivityDetail'
layout => 'default'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
components => array(
[maximum depth reached]
)
viewClass => 'View'
View => null
ext => '.ctp'
plugin => null
cacheAction => false
passedArgs => array(
[maximum depth reached]
)
scaffold => false
methods => array(
[maximum depth reached]
)
modelClass => 'Prefix'
modelKey => 'main'
validationErrors => null
Session => object(SessionComponent) {}
Info => object(Info) {}
[protected] _responseClass => 'CakeResponse'
[protected] _mergeParent => 'AppController'
[protected] _eventManager => object(CakeEventManager) {}
[private] title_for_layout => 'AGTRACE CMU,Faculty of Agriculture Chiangmai University'
[private] keywords => 'AGTRACE CMU,Faculty of Agriculture Chiangmai University'
[private] keywordsTh => 'AGTRACE CMU,Faculty of Agriculture Chiangmai University'
[private] description => 'AGTRACE CMU,Faculty of Agriculture Chiangmai University'
[private] img_url => 'https://www.agtracecmu.agri.cmu.ac.th/'
}
array(
(int) 0 => '59303905'
)
CORE\Cake\Routing\Dispatcher.php line 191 → Controller->invokeAction(CakeRequest)
$response = $controller -> response ;
$render = true ;
$result = $controller -> invokeAction ( $request );
if ( $result instanceof CakeResponse ) {
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array([maximum depth reached])
url => 'main/InfoActivityDetail/59303905'
base => ''
webroot => '/'
here => '/main/InfoActivityDetail/59303905'
[protected] _detectors => array(
[maximum depth reached]
)
[protected] _input => ''
}
CORE\Cake\Routing\Dispatcher.php line 165 → Dispatcher->_invoke(MainController, CakeRequest) ));
}
$response = $this -> _invoke ( $controller , $request );
if (isset( $request -> params [ 'return' ])) {
object(MainController) {
paginate => array(
[maximum depth reached]
)
uses => array(
[maximum depth reached]
)
name => 'Main'
helpers => array([maximum depth reached])
request => object(CakeRequest) {}
response => object(CakeResponse) {}
viewPath => 'Main'
layoutPath => null
viewVars => array(
[maximum depth reached]
)
view => 'InfoActivityDetail'
layout => 'default'
autoRender => true
autoLayout => true
Components => object(ComponentCollection) {}
components => array(
[maximum depth reached]
)
viewClass => 'View'
View => null
ext => '.ctp'
plugin => null
cacheAction => false
passedArgs => array(
[maximum depth reached]
)
scaffold => false
methods => array(
[maximum depth reached]
)
modelClass => 'Prefix'
modelKey => 'main'
validationErrors => null
Session => object(SessionComponent) {}
Info => object(Info) {}
[protected] _responseClass => 'CakeResponse'
[protected] _mergeParent => 'AppController'
[protected] _eventManager => object(CakeEventManager) {}
[private] title_for_layout => 'AGTRACE CMU,Faculty of Agriculture Chiangmai University'
[private] keywords => 'AGTRACE CMU,Faculty of Agriculture Chiangmai University'
[private] keywordsTh => 'AGTRACE CMU,Faculty of Agriculture Chiangmai University'
[private] description => 'AGTRACE CMU,Faculty of Agriculture Chiangmai University'
[private] img_url => 'https://www.agtracecmu.agri.cmu.ac.th/'
}
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array([maximum depth reached])
url => 'main/InfoActivityDetail/59303905'
base => ''
webroot => '/'
here => '/main/InfoActivityDetail/59303905'
[protected] _detectors => array(
[maximum depth reached]
)
[protected] _input => ''
}
APP\webroot\index.php line 108 → Dispatcher->dispatch(CakeRequest, CakeResponse) $Dispatcher -> dispatch (
new CakeRequest (),
new CakeResponse ()
);
object(CakeRequest) {
params => array(
[maximum depth reached]
)
data => array([maximum depth reached])
query => array([maximum depth reached])
url => 'main/InfoActivityDetail/59303905'
base => ''
webroot => '/'
here => '/main/InfoActivityDetail/59303905'
[protected] _detectors => array(
[maximum depth reached]
)
[protected] _input => ''
}
object(CakeResponse) {
[protected] _statusCodes => array(
[maximum depth reached]
)
[protected] _mimeTypes => array(
[maximum depth reached]
)
[protected] _protocol => 'HTTP/1.1'
[protected] _status => (int) 200
[protected] _contentType => 'text/html'
[protected] _headers => array([maximum depth reached])
[protected] _body => null
[protected] _file => null
[protected] _fileRange => null
[protected] _charset => 'UTF-8'
[protected] _cacheDirectives => array([maximum depth reached])
[protected] _cookies => array([maximum depth reached])
}