Skip to content

Illegal string offset PHP 5.4 #2016

@Airclaim

Description

@Airclaim

Help me understand.

The plug has not been updated for a long time http://market.osclass.org/plugins/attributes/real-state-attributes_6

In the transition to PHP 5.4 is presented error.

Help, to deal with the error:

Warning: Illegal string offset 'pk_i_id' in C:\OpenServer\domains\oc-classrus.loc\oc-content\plugins\realestate_attributes\conf.php on line 109

Warning: Illegal string offset 's_name' in C:\OpenServer\domains\oc-classrus.loc\oc-content\plugins\realestate_attributes\conf.php on line 109

Warning: Illegal string offset 'pk_i_id' in C:\OpenServer\domains\oc-classrus.loc\oc-content\plugins\realestate_attributes\conf.php on line 109

Warning: Illegal string offset 's_name' in C:\OpenServer\domains\oc-classrus.loc\oc-content\plugins\realestate_attributes\conf.php on line 109

Line 109
$data[$locale['pk_c_code']] = array('pk_i_id' => $c['pk_i_id'], 's_name' => $c['s_name']);
File
`<?php if (!defined('OC_ADMIN') || OC_ADMIN!==true) exit('Access is not allowed.');
/*

  •  OSCLass – software for creating and publishing online classified
    
  •                       advertising platforms
    
  •                    Copyright (C) 2010 OSCLASS
    
  •   This program is free software: you can redistribute it and/or
    
  • modify it under the terms of the GNU Affero General Public License
    
  • as published by the Free Software Foundation, either version 3 of
    
  •        the License, or (at your option) any later version.
    
  • This program is distributed in the hope that it will be useful, but
    
  •     WITHOUT ANY WARRANTY; without even the implied warranty of
    
  •    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
  •         GNU Affero General Public License for more details.
    
  •  You should have received a copy of the GNU Affero General Public
    
  • License along with this program. If not, see http://www.gnu.org/licenses/.
    */
    ?>
deletePropertyType( Params::getParam('id') ) ; } } else if(Params::getParam('plugin_action')=="type_add") { $dataItem = array(); $request = Params::getParamsAsArray(); foreach ($request as $k => $v) { if (preg_match('|(.+?)#(.+)|', $k, $m)) { $dataItem[$m[1]][$m[2]] = $v; } } // insert locales $lastId = ModelRealEstate::newInstance()->getLastPropertyTypeId(); $lastId = $lastId['pk_i_id'] + 1 ; foreach ($dataItem as $k => $_data) { ModelRealEstate::newInstance()->insertPropertyType($lastId, $k, $_data['property_type']); } } else if(Params::getParam('plugin_action')=="type_edit") { $property_type = Params::getParam('property_type'); foreach($property_type as $k => $v) { foreach($v as $kj => $vj) { ModelRealEstate::newInstance()->replacePropertyType($k, $kj, $vj); } } } } ?>
getPropertyTypes(false) ; $data = array(); foreach ($property_type as $c) { $data[$c['fk_c_locale_code']][] = array('pk_i_id' => $c['pk_i_id'], 's_name' => $c['s_name']); } $default = current($data); if(is_array($default)) { foreach($default as $d) { $data['new'][] = array('pk_i_id' => $d['pk_i_id'], 's_name' => ''); }} ?>

    0) { foreach(isset($data[$locale['pk_c_code']])?$data[$locale['pk_c_code']]:$data['new'] as $property_type) { ?>
                <div class="tabber">
                <?php $locales = osc_get_locales();
                    $data = array();
                    foreach ($property_type as $c) {
                        $data[$locale['pk_c_code']] = array('pk_i_id' => $c['pk_i_id'], 's_name' => $c['s_name']);
                    }
                ?>
                <?php foreach($locales as $locale) {?>
                    <div class="tabbertab">
                        <h2><?php echo $locale['s_name']; ?></h2>
                        <input name="<?php echo  $locale['pk_c_code'];?>#property_type" id="property_type" type="text" value="" />
                    </div>
                <?php }; ?>
                </div>
                <button type="submit" ><?php _e('Add new', 'realestate_attributes'); ?></button>
            </form>
        </fieldset>
    </div>
    <div style="clear: both;"></div>                                        
</div>

.

    <div style="clear: both;"></div>
</div>
`

(url)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions