Fehler #241
geschlossenUnterstützung #216: Browserinkompatibilitäten und Testen
Unterstützung #239: Formulare testen
Seite parentChild/create
100%
Beschreibung
Rolle: Eltern, Seite: parentChild/create, Aktion: Eingabe von 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
für Vor- und Nachname gibt einen Fehler.
PHP notice
Trying to get property of non-object
/home/est/public_html/est_trunk/protected/models/ParentChild.php(91)
079 $childCheck = Child::model()->findByAttributes(array('firstname' => $this->childFirstName, 'lastname' => $this->childLastName));
080 if ($childCheck != null) {
081 if (ParentChild::model()->findByAttributes(array('child_id' => $childCheck->id, 'user_id' => $this->user_id)) >= '1') {
082 $rc = false;
083 Yii::app()->user->setFlash('failMsg', 'Kind wurde bereits eingetragen.');
084 }
085 }
086 if ($rc) {
087 $child = new Child;
088 $child->firstname = $this->childFirstName;
089 $child->lastname = $this->childLastName;
090 $child->save();
091 $child->id = Child::model()->findByAttributes(array('firstname' => $this->childFirstName, 'lastname' => $this->childLastName))->id;
092 $this->child_id = $child->id;
093 }
094 }
095 return $rc;
096 }
097
098 /**
099 * Returns the static model of the specified AR class.
100 * @param string $className active record class name.
101 * @return ParentChild the static model class
102 */
103 public static function model($className = CLASS) {
Stack Trace
#0
/home/est/public_html/est_trunk/framework/db/ar/CActiveRecord.php(1051): ParentChild->beforeSave()
#1
/home/est/public_html/est_trunk/framework/db/ar/CActiveRecord.php(799): CActiveRecord->insert(null)
#2
–
/home/est/public_html/est_trunk/protected/controllers/ParentChildController.php(123): CActiveRecord->save()
118 }
119 if ($model->validate()) {
120 if (ParentChild::model()->countByAttributes(
121 array('user_id' => $model->attributes['user_id'])) <
122 Yii::app()->params['maxChild']) {
123 if ($model->save()) {
124 Yii::app()->user->setFlash('success', 'Kind erfolgreich hinzugefügt.');
125 }
126 } else {
127 Yii::app()->user->setFlash('failMsg', 'Sie haben die Anzahl der maximal eintragbaren Kinder überschritten.');
128 }
#3
/home/est/public_html/est_trunk/framework/web/actions/CInlineAction.php(49): ParentChildController->actionCreate()
#4
/home/est/public_html/est_trunk/framework/web/CController.php(308): CInlineAction->runWithParams(array("r" => "parentChild/create"))
#5
/home/est/public_html/est_trunk/framework/web/filters/CFilterChain.php(133): CController->runAction(CInlineAction)
#6
/home/est/public_html/est_trunk/framework/web/filters/CFilter.php(40): CFilterChain->run()
#7
/home/est/public_html/est_trunk/framework/web/CController.php(1145): CFilter->filter(CFilterChain)
#8
/home/est/public_html/est_trunk/framework/web/filters/CInlineFilter.php(58): CController->filterAccessControl(CFilterChain)
#9
/home/est/public_html/est_trunk/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter(CFilterChain)
#10
/home/est/public_html/est_trunk/framework/web/CController.php(291): CFilterChain->run()
#11
/home/est/public_html/est_trunk/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array("accessControl"))
#12
/home/est/public_html/est_trunk/framework/web/CWebApplication.php(282): CController->run("create")
#13
/home/est/public_html/est_trunk/framework/web/CWebApplication.php(141): CWebApplication->runController("parentChild/create")
#14
/home/est/public_html/est_trunk/framework/base/CApplication.php(169): CWebApplication->processRequest()
#15
–
/home/est/public_html/est_trunk/index.php(30): CApplication->run()
25 defined('YII_DEBUG') or define('YII_DEBUG', true);
26 // specify how many levels of call stack should be shown in each log message
27 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
28
29 require_once($yii);
30 Yii::createWebApplication($config)->run();