search form error: regions/cities appear/disappear

Write about issues that you have found.

Moderators: Koduc, Xpycm

Forum rules
Pay attention! Forum is not a means for guaranteed support of clients and users. An answer as well as a quick answer is not supposed on the forum. We post messages as soon as possible.

The message limit on the forum is 3 messages per day.
If you want to say "thank you" then use the function "Give good reputation point", which is a green icon "plus" under the nickname of the person, who answered the message.

search form error: regions/cities appear/disappear

Postby support » 20 Jan 2014, 11:30

if you select a country, the Region options can't be found. Just until you select a Property type. When you select that - the regions appear.
Then, the city still cannot be selected until you select/change Property type again.
If you change Region - the cities disappear again, just until you change Property type (again).


You can do the following:
In the protected/modules/apartments/views/backend/__form_general.php file
instead of
 
Code: Select all
array('id'=>'ap_country',
                 'ajax' => array(
                 'type'=>'POST', //request type     

write
 
Code: Select all
array('id'=>'ap_country',
                 'ajax' => array(
                    'type'=>'GET', //request type      


instead of
Code: Select all
array('id'=>'ap_region',
                 'ajax' => array(
                 'type'=>'POST', //request type     

write
Code: Select all
array('id'=>'ap_region',
                 'ajax' => array(
                    'type'=>'GET', //request type     
 

in the protected/modules/location/controllers/MainController.php file
instead of
     
Code: Select all
public function actionGetCities() {
        $region = Yii::app()->request->getPost('region', 0);
        $type = Yii::app()->request->getPost('type', 0); 

write
     
Code: Select all
public function actionGetCities() {
        $region = Yii::app()->request->getQuery('region', 0);
        $type = Yii::app()->request->getQuery('type', 0); 



instead of
    
Code: Select all
 public function actionGetRegions() {
        $country = Yii::app()->request->getPost('country', 0);
        $type = Yii::app()->request->getPost('type', 0);
        $all = Yii::app()->request->getPost('all', 0); 

write
     
Code: Select all
public function actionGetRegions() {
        $country = Yii::app()->request->getQuery('country', 0);
        $type = Yii::app()->request->getQuery('type', 0);
        $all = Yii::app()->request->getQuery('all', 0); 


In the
protected/modules/location/views/backend/city/_form.php file
instead of
                 
Code: Select all
array('id'=>'ap_country',
                     'ajax' => array(
                        'type'=>'POST', //request type     

write
                
Code: Select all
 array('id'=>'ap_country',
                     'ajax' => array(
                        'type'=>'GET', //request type      



In the protected/views/site/_search_field_location.php file
instead of
            
Code: Select all
 array('class' => $fieldClass . ' searchField', 'id' => 'country',
                 'ajax' => array(
                    'type'=>'POST', //request type     

write
             
Code: Select all
array('class' => $fieldClass . ' searchField', 'id' => 'country',
                 'ajax' => array(
                    'type'=>'GET', //request type      
support
Citizen
Citizen
 
Posts: 136
Joined: 28 Dec 2011, 13:14
Reputation point: 0

Re: search form error: regions/cities appear/disappear

Postby jeffer » 20 Jan 2014, 12:07

You forgot this in protected/views/site/_search_field_location.php

Code: Select all
array('class' => $fieldClass ' searchField''id' => 'region',
                
'ajax' => array(
                    
'type'=>'GET'//request type 


Was POST as well ...
jeffer
Stranger
 
Posts: 3
Joined: 26 Dec 2013, 21:57
Reputation point: 0


Return to Issues

Who is online

Users browsing this forum: No registered users and 7 guests

cron