Errors of the version 1.35.0
Posted: 30 Aug 2021, 15:11
Errors of the version 1.35.0
Discussion of company’s products and Yii framework
https://monoray.net/forum/
rogerbr9999 wrote:sorry for my english ...
I have error - in property show video (youtube) 5 times
And I need to disable the LOAN CALCULATOR
in property . (anyone can help ?)
thanks
if (isset($_POST[$className]['video_html']) && $_POST[$className]['video_html']) {
$ad->video_html = $_POST[$className]['video_html'];
$ad->scenario = 'video_html';
if ($ad->validate(['video_html'])) {
$sql = 'INSERT INTO {{apartment_video}} (apartment_id, video_file, video_html, date_updated)
VALUES ("' . $ad->id . '", "", "' . CHtml::encode($ad->video_html) . '", NOW())';
Yii::app()->db->createCommand($sql)->execute();
if (issetModule('historyChanges')) {
HistoryChanges::addApartmentInfoToHistory('add_video', $ad->id, 'create');
}
$ad->video_html = '';
} else {
return false;
}
}
if (isset($_POST[$className]['video_html']) && $_POST[$className]['video_html']) {
$ad->video_html = $_POST[$className]['video_html'];
$ad->scenario = 'video_html';
if ($ad->validate(['video_html'])) {
$isAutoSave = Yii::app()->request->getPost('is_auto_save');
$keyAutoSave = md5($ad->video_html.$ad->id);
if($isAutoSave && Yii::app()->cache->get($keyAutoSave)){
return true;
}
$sql = 'INSERT INTO {{apartment_video}} (apartment_id, video_file, video_html, date_updated)
VALUES ("' . $ad->id . '", "", "' . CHtml::encode($ad->video_html) . '", NOW())';
Yii::app()->db->createCommand($sql)->execute();
if (issetModule('historyChanges')) {
HistoryChanges::addApartmentInfoToHistory('add_video', $ad->id, 'create');
}
if($isAutoSave){
Yii::app()->cache->set($keyAutoSave, 1, 10800);
}
$ad->video_html = '';
} else {
return false;
}
}