Remove 'No filters' option, as it causes errors

This commit is contained in:
Nathan Gray 2015-05-04 20:11:52 +00:00
parent e15f9803d2
commit 1d88af167c
2 changed files with 23 additions and 2 deletions

View File

@ -81,7 +81,7 @@ class calendar_favorite_portlet extends home_favorite_portlet
} }
$content = array('legacy' => ''); $content = array('legacy' => '');
switch($this->favorite['state']['view']) switch($this->favorite['state']['view'])
{ {
case 'listview': case 'listview':
@ -197,4 +197,23 @@ class calendar_favorite_portlet extends home_favorite_portlet
} }
} }
} }
/**
* No filters default favorite causes problems with calendar's special state handling,
* so just remove it.
* @return type
*/
public function get_properties()
{
$properties = parent::get_properties();
foreach($properties as &$property)
{
if($property['name'] == 'favorite')
{
unset($property['select_options']['blank']);
break;
}
}
return $properties;
}
} }

View File

@ -878,7 +878,9 @@ app.classes.home.home_favorite_portlet = app.classes.home.home_portlet.extend({
this._super.apply(this, arguments); this._super.apply(this, arguments);
// Somehow favorite got lost, or is not set // Somehow favorite got lost, or is not set
if(!portlet.options.settings.favorite) if(portlet.options && portlet.options.settings && typeof portlet.options.settings !== 'undefined' &&
!portlet.options.settings.favorite
)
{ {
portlet.edit_settings(); portlet.edit_settings();
} }