Projekt

Allgemein

Profil

Aktionen

Fehler #241

geschlossen

Unterstützung #216: Browserinkompatibilitäten und Testen

Unterstützung #239: Formulare testen

Seite parentChild/create

Von Matthias Unterbusch vor fast 11 Jahren hinzugefügt. Vor fast 11 Jahren aktualisiert.

Status:
Erledigt
Priorität:
Normal
Zugewiesen an:
Kategorie:
Back-End
Zielversion:
Beginn:
07.05.2013
Abgabedatum:
% erledigt:

100%

Geschätzter Aufwand:

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();

Aktionen #1

Von Christian Ehringfeld vor fast 11 Jahren aktualisiert

  • Status wurde von Neu zu Erledigt geändert
  • Zielversion wurde auf 1.2 gesetzt
  • % erledigt wurde von 0 zu 100 geändert

r586

Aktionen #2

Von Matthias Unterbusch vor fast 11 Jahren aktualisiert

  • Status wurde von Erledigt zu In Bearbeitung geändert

Bei der selben Eingabe taucht nun folgender Fehler auf:

CException

Eigenschaft "ParentChild.childFirstname ist nicht definiert.

/home/est/public_html/est_trunk/framework/db/ar/CActiveRecord.php(145)

133 /
134 public function _get($name)
135 {
136 if(isset($this->_attributes[$name]))
137 return $this->_attributes[$name];
138 elseif(isset($this->getMetaData()->columns[$name]))
139 return null;
140 elseif(isset($this->_related[$name]))
141 return $this->_related[$name];
142 elseif(isset($this->getMetaData()->relations[$name]))
143 return $this->getRelated($name);
144 else
145 return parent::
_get($name);
146 }
147
148 /**
149 * PHP setter magic method.
150 * This method is overridden so that AR attributes can be accessed like properties.
151 * @param string $name property name
152 * @param mixed $value property value
153 */
154 public function __set($name,$value)
155 {
156 if($this->setAttribute($name,$value)===false)
157 {

Stack Trace
#0

/home/est/public_html/est_trunk/framework/db/ar/CActiveRecord.php(145): CComponent->_get("childFirstname")
#1

/home/est/public_html/est_trunk/framework/validators/CStringValidator.php(79): CActiveRecord->
_get("childFirstname")
#2

/home/est/public_html/est_trunk/framework/validators/CValidator.php(213): CStringValidator->validateAttribute(ParentChild, "childFirstname")
#3

/home/est/public_html/est_trunk/framework/base/CModel.php(159): CValidator->validate(ParentChild, null)
#4

/home/est/public_html/est_trunk/protected/controllers/ParentChildController.php(119): CModel->validate()

114 if (isset($_POST['ParentChild'])) {
115 $model->attributes = $_POST['ParentChild'];
116 if (isset($model->user->firstname) && isset($model->user->lastname)) {
117 $userNameString = $model->user->firstname . " " . $model->user->lastname;
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.');

#5

/home/est/public_html/est_trunk/framework/web/actions/CInlineAction.php(49): ParentChildController->actionCreate()
#6

/home/est/public_html/est_trunk/framework/web/CController.php(308): CInlineAction->runWithParams(array("r" => "parentChild/create"))
#7

/home/est/public_html/est_trunk/framework/web/filters/CFilterChain.php(133): CController->runAction(CInlineAction)
#8

/home/est/public_html/est_trunk/framework/web/filters/CFilter.php(40): CFilterChain->run()
#9

/home/est/public_html/est_trunk/framework/web/CController.php(1145): CFilter->filter(CFilterChain)
#10

/home/est/public_html/est_trunk/framework/web/filters/CInlineFilter.php(58): CController->filterAccessControl(CFilterChain)
#11

/home/est/public_html/est_trunk/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter(CFilterChain)
#12

/home/est/public_html/est_trunk/framework/web/CController.php(291): CFilterChain->run()
#13

/home/est/public_html/est_trunk/framework/web/CController.php(265): CController->runActionWithFilters(CInlineAction, array("accessControl"))
#14

/home/est/public_html/est_trunk/framework/web/CWebApplication.php(282): CController->run("create")
#15

/home/est/public_html/est_trunk/framework/web/CWebApplication.php(141): CWebApplication->runController("parentChild/create")
#16

/home/est/public_html/est_trunk/framework/base/CApplication.php(169): CWebApplication->processRequest()
#17

/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();

Aktionen #3

Von Matthias Unterbusch vor fast 11 Jahren aktualisiert

Bei der Eingabe eines Benutzernames, ist es mir gar nicht möglich etwas so langes einzugeben. Kann man das hier auch einbauen?

Aktionen #4

Von Christian Ehringfeld vor fast 11 Jahren aktualisiert

  • Status wurde von In Bearbeitung zu Erledigt geändert

Jetzt sollte es gehn, warn noch zwei Tippfehler drin..., ja sowas geht theoretisch ich habs jetzt auf 255 zeichen in php begrenzt

Aktionen

Auch abrufbar als: Atom PDF