Ребята,прошу помочь.Сделали программу-система тестирования на заказ.Тестирую на OpenServer.Всё работает кроме добавления,изменения и удаления лекций.Программист говорит,что проблема в OpenServer.При выключенных ошибках PHP страница не открывается,а если включить,то пишет ошибку: Fatal error: Call to a member function SetEmptyAnswerEnable() on null in C:\OSPanel\domains\test_system\web\forms\TLectureInsertForm.php on line 50 Прошу помочь разобраться. PHP: <?php // class TLectureInsertForm extends TInsertForm { // public $etNumber = NULL; public $etName = NULL; public $etQuestionary = NULL; function Initialization ($Self) { // $this->SetCaption ('Добавить лекцию'); $this->GetGrid ()->SetHtmlWidth ('60%'); $this->GetGrid ()->SetHtmlAlign (haCenter); $Obj = new THtmlInputText (); $Obj->SetName ($this->GetName() . 'Number'); $Obj->SetMethod ($this->GetMethod ()); $Obj->SetCaption ('Номер лекции'); $Obj->SetHtmlSize ('30'); $this->AddObject ($Obj); $this->etNumber = $Obj; $Obj = new THtmlInputText (); $Obj->SetName ($this->GetName() . 'Name'); $Obj->SetMethod ($this->GetMethod ()); $Obj->SetCaption ('Название'); $Obj->SetHtmlSize ('30'); $this->AddObject ($Obj); $this->etName = $Obj; /* $Obj = new THtmlInputComboBox (); $Obj->SetName ($this->GetName() . 'Questionary'); $Obj->SetMethod ($this->GetMethod ()); $Obj->SetCaption ('Тестирование'); $this->AddObject ($Obj); $this->cbQuestionary = $Obj; */ } function InitializationData ($Self) { $this->DataSet = $this->GetController()->GetData ()->GetLecture (); $dsQuestionary = $this->GetController()->GetData ()->GetQuestionary (); $dsQuestionary->SetFilter ('IsAccessible = 1'); $dsQuestionary->Open (); $this->cbQuestionary->SetEmptyAnswerEnable (true); $this->cbQuestionary->GetList ()->Add ('0', 'Не выбрано'); $this->cbQuestionary->GetList ()->LoadFromDataSet ($dsQuestionary, 'ID_Questionary', 'Name'); $dsQuestionary->Close (); $this->DataSource = new TDataSource (); $this->DataSource->SetDataSet ($this->DataSet); //$this->DataSource->Add ('ID_Questionary', $this->cbQuestionary); $this->DataSource->Add ('Name', $this->etName); $this->DataSource->Add ('Number', $this->etNumber); } function OnBeforeOperation ($Sender) { // $this->DataSet->GetFieldByName ('ID_Subject')->SetValue ($this->GetController()->GetSubjectID ()); } } ?>
нет. метод объекта можно вызвать из объекта если есть объект, а у тебя в переменной пустота. видимо выше что-то обломилось и не сработало. надо смотреть выше по коду, что там не так.