NPE при открытии папок поиска, созданных в cuba 5.3 #PL-5183

This commit is contained in:
Maxim Gorbunkov 2015-04-02 11:45:40 +00:00
parent f90e0bf3a5
commit 9d852de70b

View File

@ -445,7 +445,6 @@ public class FilterDelegateImpl implements FilterDelegate {
MakeDefaultAction makeDefaultAction = new MakeDefaultAction();
RemoveAction removeAction = new RemoveAction();
PinAppliedAction pinAppliedAction = new PinAppliedAction();
// hideConditionsAction = new HideConditionsAction();
SaveAsFolderAction saveAsAppFolderAction = new SaveAsFolderAction(true);
SaveAsFolderAction saveAsSearchFolderAction = new SaveAsFolderAction(false);
@ -475,7 +474,6 @@ public class FilterDelegateImpl implements FilterDelegate {
&& !(lastAppliedFilter.getFilterEntity() == adHocFilter && lastAppliedFilter.getConditions().getRoots().size() == 0);
boolean saveAsSearchFolderActionEnabled = !isFolder && !hasCode;
boolean saveAsAppFolderActionEnabled = !isFolder && !hasCode;
boolean hideConditionsActionEnabled = isHideConditionsActionEnabled();
saveAction.setEnabled(saveActionEnabled);
saveAsAction.setEnabled(saveAsActionEnabled);
@ -485,7 +483,6 @@ public class FilterDelegateImpl implements FilterDelegate {
pinAppliedAction.setEnabled(pinAppliedActionEnabled);
saveAsSearchFolderAction.setEnabled(saveAsSearchFolderActionEnabled);
saveAsAppFolderAction.setEnabled(saveAsAppFolderActionEnabled);
// hideConditionsAction.setEnabled(hideConditionsActionEnabled);
settingsBtn.addAction(saveAction);
settingsBtn.addAction(saveAsAction);
@ -495,7 +492,6 @@ public class FilterDelegateImpl implements FilterDelegate {
if (globalConfig.getAllowQueryFromSelected()) {
settingsBtn.addAction(pinAppliedAction);
}
// settingsBtn.addAction(hideConditionsAction);
if (folderActionsEnabled && filterHelper.isFolderActionsEnabled()) {
settingsBtn.addAction(saveAsSearchFolderAction);
settingsBtn.addAction(saveAsAppFolderAction);
@ -505,17 +501,6 @@ public class FilterDelegateImpl implements FilterDelegate {
}
}
protected boolean isHideConditionsActionEnabled() {
boolean visibleConditionsExist = false;
for (AbstractCondition condition : conditions.toConditionsList()) {
if (!condition.getHidden()) {
visibleConditionsExist = true;
break;
}
}
return !filterEntity.getIsSet() && filterEntity.getFolder() == null && conditions != null && visibleConditionsExist;
}
protected boolean getUserCanEditGlobalFilter() {
return userSessionSource.getUserSession().isSpecificPermitted(GLOBAL_FILTER_PERMISSION);
}