Page 1 of 1

Errors of the version 1.35.0

PostPosted: 30 Aug 2021, 15:11
by support
Errors of the version 1.35.0

Re: Errors of the version 1.35.0

PostPosted: 15 Sep 2021, 21:46
by rogerbr9999
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

Re: Errors of the version 1.35.0

PostPosted: 20 Sep 2021, 11:01
by andipas
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


Thanks for the bug found.
To fix in the file - protected\modules\apartments\models\ApartmentVideo.php
replace the code
Code: Select all

        
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;
            }
        }
 


to this code:
Code: Select all

        
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($keyAutoSave110800);
                }

                
$ad->video_html '';
            } else {
                return 
false;
            }
        }
 


LOAN CALCULATOR can be disabled in the site settings