Support Forums

Support Online : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Sp property bug?

Featured Lock Resolved Bug
Heyo,

just found and fixed a bug about sp property features.

How to reproduce:

1) Create property
2) Create some features
3) Go to property details and check one or more features, and save.
4) Return to property details and try to uncheck all features.

I've tried all cases, but it seems that it's not allowed to return to 0 features for a property which already has one or more features checked.
If you uncheck all, it looks like it doesn't save at all, but you can uncheck all but one and save, and it's fine.

The fact is, you cannot leave all unchecked, you must leave one checked ATM.

How to fix:

go to administrator/com_spproperty/tables/property.php

Around line 30 and edit bind() method as marked:


public function bind($src, $ignore = array())
{
if (isset($src['gallery']) && is_array($src['gallery']))
{
$registry = new JRegistry();
$registry->loadArray($src['gallery']);
$src['gallery'] = (string) $registry;
}


if (isset($src['features']) && is_array($src['features']) && !empty($src['features']))
{

$src['features'] = json_encode($src['features']);
//var_dump($src['features']);exit();
}
//ADDED THIS**************************************************************
elseif(empty($src['features'])){

$src['features'] = '';
//var_dump($src['features']);exit();
}
//END**********************************************************************************

if (isset($src['latitude']) && isset($src['longitude']))
{
$src['map'] = $src['latitude'] . ',' . $src['longitude'];
}

if (isset($src['floor_plans']) && is_array($src['floor_plans']))
{
$registry = new JRegistry();
$registry->loadArray($src['floor_plans']);
$src['floor_plans'] = (string) $registry;
}
//var_dump($src);exit;

return parent::bind($src, $ignore);
}


I hope you will fix this in next updates because I don't like to edit core files. Thanks

2 Answers

Please login to view replies.

Leaderboard (30 days)

Sifat

Sifat

Total Accepted Answers: 131
Paul Frankowski

Paul Frankowski

Total Accepted Answers: 112
Toufiq

Toufiq

Total Accepted Answers: 55
Pavel

Pavel

Total Accepted Answers: 3
JD

Josh Douglas

Total Accepted Answers: 3

100+

Templates

200,000+

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us