*

O.Marcos

  • *
  • 1 posts
Real Etates Attributes Plugin (Free)
« on: September 21, 2025, 04:00:02 PM »
We're testing Osclass with some free plugins to understand how Osclas works with different types of products.
When trying to install the free Real Estate Attributes Plugin (v. 3.4.2), an error message appears and the installation aborts.

Error:
Plugin couldn't be installed because of: 1005 - Can't create table `osclassurbe_osclass8`.`oc_t_item_house_description_attr` (errno: 150 "Foreign key constraint is incorrectly formed")

Thank you for your attention.

*

MB Themes

Re: Real Etates Attributes Plugin (Free)
« Reply #1 on: September 22, 2025, 08:33:10 AM »
Usually means your database tables use different than default db engine (InnoDB), then foreign keys cannot be created.
Alternative is that column definitions were changed and now not matching to expectations.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

znatok90

  • *
  • 1 posts
Re: Real Etates Attributes Plugin (Free)
« Reply #2 on: October 13, 2025, 12:02:21 AM »
Usually means your database tables use different than default db engine (InnoDB), then foreign keys cannot be created.
Alternative is that column definitions were changed and now not matching to expectations.
Hello. I can't add this plugin to my website. I tried to do it on another website with "0" but it always gives this error. Please help me fix it.

xPlugin couldn't be installed because of: 3780 - Referencing column 'fk_c_locale_code' and referenced column 'pk_c_code' in foreign key constraint 'oc_t_item_house_description_attr_ibfk_1' are incompatible.

-----

SQL-request: Copy


ALTER TABLE oc_t_locale MODIFY pk_c_code VARCHAR(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
Answer MySQL: Documents

#3780 - Referencing column 'fk_c_locale_code' and referenced column 'pk_c_code' in foreign key constraint 'oc_t_user_description_ibfk_2' are incompatible.

*

MB Themes

Re: Real Etates Attributes Plugin (Free)
« Reply #3 on: October 13, 2025, 08:22:20 AM »
That's OK error message.
Suppose you have changed your encoding to utf8mb4 that must be done on foreign key too, but in this case does not make much sense, I think better to reverse fk_c_locale_code to original value.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

slaven

  • ***
  • 99 posts
Re: Real Etates Attributes Plugin (Free)
« Reply #4 on: March 19, 2026, 01:00:14 PM »
Real estate 3.4.2 works best with PHP 8.1 ... on 8.3 it shows an error ...


Warning: Undefined array key 0  in /home/site/web/site.com/public_html/oc-content/plugins/realestate_attributes/item_edit.php on line 266

Warning: Trying to access array offset on null in ... public_html/oc-content/plugins/realestate_attributes/item_edit.php on line 257


How to adapt for PHP 8.3 or 8.4?
« Last Edit: April 29, 2026, 10:39:03 PM by slaven »
Osclass

*

MB Themes

Re: Real Etates Attributes Plugin (Free)
« Reply #5 on: March 20, 2026, 03:12:44 PM »
@slaven

Try to replace file content with this (not tested):

Code: [Select]
<div class="real-attr-post">
  <h2><?php _e('Realestate attributes''realestate_attributes'); ?></h2>
 
  <?php
    $locales 
osc_get_locales();
    
$first_locale $locales[array_key_first($locales)] ?? array();
    
$first_locale_code = ($first_locale['pk_c_code'] ?? '');
  
?>


  <div class="box">
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_property_type') != '' ) {
          
$detail['e_type'] = Session::newInstance()->_getForm('pre_property_type');
        }
      
?>

      <label for="property_type"><?php _e('Type''realestate_attributes'); ?></label>
      <select name="property_type" id="property_type">
        <option value="FOR RENT" <?php if(@$detail['e_type'] == 'FOR RENT') { echo "selected"; } ?>><?php _e('For rent''realestate_attributes'); ?></option>
        <option value="FOR SALE" <?php if(@$detail['e_type'] == 'FOR SALE') { echo "selected"; } ?>><?php _e('For sale''realestate_attributes'); ?></option>
      </select>
    </div>
    <div class="row">
      <?php
      
if(count($locales)==1) {
      
?>

        <?php
          
if( Session::newInstance()->_getForm('pre_p_type') != '' ) {
            
$detail['fk_i_property_type_id'] = Session::newInstance()->_getForm('pre_p_type');
          }
        
?>

        <label><?php _e('Property type''realestate_attributes'); ?></label>
        <select name="p_type" id="p_type">
        <?php foreach($p_type[$first_locale_code] as $k => $v) { ?>
          <option value="<?php echo  $k?>" <?php if($k == @$detail['fk_i_property_type_id']) { echo 'selected'; } ?>><?php echo @$v?></option>
        <?php ?>
        </select>
      <?php } else { ?>
        <div class="tabber">
        <?php
          
if( Session::newInstance()->_getForm('pre_p_type') != '' ) {
            
$detail['fk_i_property_type_id'] = Session::newInstance()->_getForm('pre_p_type');
          }
        
?>

        <?php foreach($locales as $locale) {?>
          <div class="tabbertab">
            <h2><?php echo $locale['s_name']; ?></h2>
            <p>
              <label><?php _e('Property type''realestate_attributes'); ?></label><br />
              <select name="p_type" id="p_type">
              <?php
              
if(isset($locale['pk_c_code']) && isset($p_type[$locale['pk_c_code']])){
                if(
is_array($p_type[$locale['pk_c_code']]) && count($p_type[$locale['pk_c_code']]) > 0){
                  foreach(
$p_type[$locale['pk_c_code']] as $k => $v) { 
                    
?>

                    <option value="<?php echo $k?>" <?php if($k==@$detail['fk_i_property_type_id']) { echo 'selected';};?>><?php echo  @$v;?></option>
                    <?php
                  
}
                }
              }
              
?>

              </select>
            </p>
          </div>
        <?php ?>
        </div>
      <?php }
      
?>

    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_numRooms') != '' ) {
          
$detail['i_num_rooms'] = Session::newInstance()->_getForm('pre_numRooms');
        }
      
?>

      <label for="numRooms"><?php _e('Num. of rooms''realestate_attributes'); ?></label>
      <select name="numRooms" id="numRooms">
      <?php foreach(range(015) as $n) { ?>
        <option value="<?php echo $n?>" <?php if($n == @$detail['i_num_rooms']) { echo "selected"; } ?>><?php echo $n?></option>
      <?php ?>
      </select>
    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_numBathrooms') != '' ) {
          
$detail['i_num_bathrooms'] = Session::newInstance()->_getForm('pre_numBathrooms');
        }
      
?>

      <label for="numBathrooms"><?php _e('Num. of bathrooms''realestate_attributes'); ?></label>
      <select name="numBathrooms" id="numBathrooms">
      <?php foreach(range(015) as $n) { ?>
        <option value="<?php echo $n?>" <?php if($n==@$detail['i_num_bathrooms']) { echo "selected"; } ?>><?php echo $n?></option>
      <?php ?>
      </select>
    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_status') != '' ) {
          
$detail['e_status'] = Session::newInstance()->_getForm('pre_status');
        }
      
?>

      <label for="status"><?php _e('Status''realestate_attributes'); ?></label>
      <select name="status" id="status">
        <option value="NEW CONSTRUCTION" <?php if(@$detail['e_status'] == 'NEW CONSTRUCTION') { echo "selected"; } ?>><?php _e('New construction''realestate_attributes'); ?></option>
        <option value="TO RENOVATE" <?php if(@$detail['e_status'] == 'TO RENOVATE') { echo "selected"; } ?>><?php _e('To renovate''realestate_attributes'); ?></option>
        <option value="GOOD CONDITION" <?php if(@$detail['e_status'] == 'GOOD CONDITION') { echo "selected"; } ?>><?php _e('Good condition''realestate_attributes'); ?></option>
      </select>
    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_squareMeters') != '' ) {
          
$detail['s_square_meters'] = Session::newInstance()->_getForm('pre_squareMeters');
        }
      
?>

      <label for="squareMeters"><?php _e('Square meters''realestate_attributes'); ?></label>
      <input type="text" name="squareMeters" id="squareMeters" value="<?php echo @$detail['s_square_meters']; ?>" size="4" maxlength="4" />
    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_year') != '' ) {
          
$detail['i_year'] = Session::newInstance()->_getForm('pre_year');
        }
      
?>

      <label for="year"><?php _e('Construction Year''realestate_attributes'); ?></label>
      <input type="text" name="year" id="year" value="<?php echo @$detail['i_year'];?>" size="4" maxlength="4" />
    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_squareMetersTotal') != '' ) {
          
$detail['i_plot_area'] = Session::newInstance()->_getForm('pre_squareMetersTotal');
        }
      
?>

      <label for="squareMetersTotal"><?php _e('Square meters (total)''realestate_attributes'); ?></label>
      <input type="text" name="squareMetersTotal" id="squareMetersTotal" value="<?php echo  @$detail['i_plot_area'];?>" size="4" maxlength="6" />
    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_numFloors') != '' ) {
          
$detail['i_num_floors'] = Session::newInstance()->_getForm('pre_numFloors');
        }
      
?>

      <label for="numFloors"><?php _e('Num. of floors''realestate_attributes'); ?></label>
      <select name="numFloors" id="numFloors">
      <?php foreach(range(015) as $n) { ?>
        <option value="<?php echo $n?>" <?php if($n == @$detail['i_num_floors']) { echo "selected"; } ?>><?php echo $n?></option>
      <?php ?>
      </select>
    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_numGarages') != '' ) {
          
$detail['i_num_garages'] = Session::newInstance()->_getForm('pre_numGarages');
        }
      
?>

      <label for="numGarages"><?php _e('Num. of garages (place for a car = one garage)''realestate_attributes'); ?></label>
      <select name="numGarages" id="numGarages">
        <?php foreach(range(015) as $n) { ?>
        <option value="<?php echo $n?>" <?php if($n==@$detail['i_num_garages']) { echo "selected"; } ?>><?php echo $n?></option>
        <?php ?>
      </select>
    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_condition') != '' ) {
          
$detail['s_condition'] = Session::newInstance()->_getForm('pre_condition');
        }
      
?>

      <label for="condition"><?php _e('Condition''realestate_attributes'); ?></label>
      <input type="text" name="condition" id="condition" value="<?php echo @$detail['s_condition']; ?>" />
    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_agency') != '' ) {
          
$detail['s_agency'] = Session::newInstance()->_getForm('pre_agency');
        }
      
?>

      <label for="agency"><?php _e('Agency''realestate_attributes'); ?></label>
      <input type="text" name="agency" id="agency" value="<?php echo @$detail['s_agency']; ?>" />
    </div>
    <div class="row">
      <?php
        
if( Session::newInstance()->_getForm('pre_floorNumber') != '' ) {
          
$detail['i_floor_number'] = Session::newInstance()->_getForm('pre_floorNumber');
        }
      
?>

      <label for="floorNumber"><?php _e('Floor Number''realestate_attributes'); ?></label>
      <input type="text" name="floorNumber" id="floorNumber" value="<?php echo @$detail['i_floor_number']; ?>" />
    </div>
    <div class="row">
      <label><?php _e('Other characteristics''realestate_attributes'); ?></label>
      <ul class="checkbox-list">
        <?php
          
if( Session::newInstance()->_getForm('pre_heating') != '' ) {
            
$detail['b_heating'] = Session::newInstance()->_getForm('pre_heating');
          }
        
?>

        <li>
          <input style="width: 18px;" type="checkbox" name="heating" id="heating" value="1" <?php if(@$detail['b_heating'] == 1) { echo 'checked="yes"'; } ?>/> <label style="float:none;" for="heating"><?php _e('Heating''realestate_attributes'); ?></label>
        </li>
        <?php
          
if( Session::newInstance()->_getForm('pre_airCondition') != '' ) {
            
$detail['b_air_condition'] = Session::newInstance()->_getForm('pre_airCondition');
          }
        
?>

        <li>
          <input style="width: 18px;" type="checkbox" name="airCondition" id="airCondition" value="1" <?php if(@$detail['b_air_condition'] == 1) { echo 'checked="yes"'; } ?>/> <label style="float:none;" for="airCondition"><?php _e('Air condition''realestate_attributes'); ?></label>
        </li>
        <?php
          
if( Session::newInstance()->_getForm('pre_elevator') != '' ) {
            
$detail['b_elevator'] = Session::newInstance()->_getForm('pre_elevator');
          }
        
?>

        <li>
          <input style="width: 18px;" type="checkbox" name="elevator" id="elevator" value="1" <?php if(@$detail['b_elevator'] == 1) { echo 'checked="yes"'; } ?>/> <label style="float:none;" for="elevator"><?php _e('Elevator''realestate_attributes'); ?></label>
        </li>
        <?php
          
if( Session::newInstance()->_getForm('pre_terrace') != '' ) {
            
$detail['b_terrace'] = Session::newInstance()->_getForm('pre_terrace');
          }
        
?>

        <li>
          <input style="width: 18px;" type="checkbox" name="terrace" id="terrace" value="1" <?php if(@$detail['b_terrace'] == 1) { echo 'checked="yes"'; } ?>/> <label style="float:none;" for="terrace"><?php _e('Terrace''realestate_attributes'); ?></label>
        </li>
        <?php
          
if( Session::newInstance()->_getForm('pre_parking') != '' ) {
            
$detail['b_parking'] = Session::newInstance()->_getForm('pre_parking');
          }
        
?>

        <li>
          <input style="width: 18px;" type="checkbox" name="parking" id="parking" value="1" <?php if(@$detail['b_parking'] == 1) { echo 'checked="yes"'; } ?>/> <label style="float:none;" for="parking"><?php _e('Parking''realestate_attributes'); ?></label>
        </li>
        <?php
          
if( Session::newInstance()->_getForm('pre_furnished') != '' ) {
            
$detail['b_furnished'] = Session::newInstance()->_getForm('pre_furnished');
          }
        
?>

        <li>
          <input style="width: 18px;" type="checkbox" name="furnished" id="furnished" value="1" <?php if(@$detail['b_furnished'] == 1) { echo 'checked="yes"'; } ?>/> <label style="float:none;" for="furnished"><?php _e('Furnished''realestate_attributes'); ?></label>
        </li>
        <?php
          
if( Session::newInstance()->_getForm('pre_new') != '' ) {
            
$detail['b_new'] = Session::newInstance()->_getForm('pre_new');
          }
        
?>

        <li>
          <input style="width: 18px;" type="checkbox" name="new" id="new" value="1" <?php if(@$detail['b_new'] == 1) { echo 'checked="yes"'; } ?>/> <label style="float:none;" for="new"><?php _e('New''realestate_attributes'); ?></label>
        </li>
        <?php
          
if( Session::newInstance()->_getForm('pre_by_owner') != '' ) {
            
$detail['b_by_owner'] = Session::newInstance()->_getForm('pre_by_owner');
          }
        
?>

        <li>
          <input style="width: 18px;" type="checkbox" name="by_owner" id="by_owner" value="1" <?php if(@$detail['b_by_owner'] == 1) { echo 'checked="yes"'; } ?>/> <label style="float:none;" for="by_owner"><?php _e('By owner''realestate_attributes'); ?></label>
        </li>
      </ul>
      <div class="clear"></div>
    </div>
    <?php
    
if(count($locales)==1) { ?>

      <div class="row">
        <?php
          
if(Session::newInstance()->_getForm('pre_'.$first_locale_code.'transport') != '' ) {
            
$detail['locale'][$first_locale_code]['s_transport'] = Session::newInstance()->_getForm('pre_'.$first_locale_code.'transport');
          }
        
?>

        <label for="transport"><?php _e('Transport''realestate_attributes'); ?></label>
        <input type="text" name="<?php echo $first_locale_code?>#transport" id="transport" value="<?php echo @$detail['locale'][$first_locale_code]['s_transport']; ?>" />
      </div>
      <div class="row">
        <?php
          
if( Session::newInstance()->_getForm('pre_'.$first_locale_code.'zone') != '' ) {
            
$detail['locale'][$first_locale_code]['s_zone'] = Session::newInstance()->_getForm('pre_'.$first_locale_code.'zone');
          }
        
?>

        <label for="zone"><?php _e('Zone''realestate_attributes'); ?></label>
        <input type="text" name="<?php echo $first_locale_code?>#zone" id="zone" value="<?php echo @$detail['locale'][$first_locale_code]['s_zone']; ?>"/>
      </div>

    <?php } else { ?>
      <div class="tabber">
        <?php foreach($locales as $locale) {?>
          <div class="tabbertab">
            <h2><?php echo $locale['s_name']; ?></h2>
            <p>
              <?php
                
if( Session::newInstance()->_getForm('pre_'.$locale['pk_c_code'].'transport') != '' ) {
                  
$detail['locale'][$locale['pk_c_code']]['s_transport'] = Session::newInstance()->_getForm('pre_'.$locale['pk_c_code'].'transport');
                }
              
?>

              <label for="transport"><?php _e('Transport''realestate_attributes'); ?></label><br />
              <input type="text" name="<?php echo $locale['pk_c_code']; ?>#transport" id="transport" value="<?php echo @$detail['locale'][$locale['pk_c_code']]['s_transport']; ?>" />
            </p>
            <p>
              <?php
                
if( Session::newInstance()->_getForm('pre_'.$locale['pk_c_code'].'zone') != '' ) {
                  
$detail['locale'][$locale['pk_c_code']]['s_zone'] = Session::newInstance()->_getForm('pre_'.$locale['pk_c_code'].'zone');
                }
              
?>

              <label for="zone"><?php _e('Zone''realestate_attributes'); ?></label><br />
              <input type="text" name="<?php echo $locale['pk_c_code']; ?>#zone" id="zone" value="<?php echo @$detail['locale'][$locale['pk_c_code']]['s_zone']; ?>"/>
            </p>
          </div>
        <?php ?>
      </div>
    <?php ?>
  </div>
</div>

<script type="text/javascript">
  if(typeof tabberAutomatic == 'function') {
    tabberAutomatic();
  }
  if(typeof themeUiHook == 'function') {
    themeUiHook();
  }
</script>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

slaven

  • ***
  • 99 posts
Re: Real Etates Attributes Plugin (Free)
« Reply #6 on: March 20, 2026, 05:03:01 PM »
Tested on PHP 8.3 ... works perfectly!
Osclass

*

MB Themes

Re: Real Etates Attributes Plugin (Free)
« Reply #7 on: March 23, 2026, 09:56:32 AM »
Great, will udpate plugin
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

fazli

  • **
  • 5 posts
Re: Real Etates Attributes Plugin (Free):
« Reply #8 on: April 20, 2026, 09:01:11 AM »
Hi everyone,

I am experiencing an issue with the Real Estate Attributes Plugin (v3.4.2 by MB Themes) on my Osclass installation.

The Problem:
When I go to the plugin's configuration page and try to uncheck specific categories (for example, "Land"), the changes are not being saved. Although I see the "Configuration was saved" message, as soon as the page refreshes or I re-enter the configuration, all categories appear checked again.

Technical Details:

Environment: Localhost (Laragon), PHP 8.x.

Database: I checked the ba_t_plugin_category table. When I manually delete a row from the database, it works temporarily. However, the plugin settings page seems to override or fail to update this table correctly via the UI.

Symptoms: Even after unchecking "Land" and clicking update, the attributes (rooms, bathrooms, heating, etc.) still appear on the "Post an Item" page for the Land category.

What I've Tried:

Clearing browser cache.

Manually deleting relations from t_plugin_category.

Checking file permissions for the plugin folder.

It seems like the update function in the plugin's admin controller is not correctly processing the $_POST data or there is a compatibility issue with modern PHP versions regarding how it handles database updates for plugin preferences.

Has anyone encountered this "auto-checking" behavior or found a fix for the saving mechanism in the plugin's index.php?

Thanks in advance for your help!