Fix widgets bundle and widget type alias creation.
This commit is contained in:
parent
2543063e4a
commit
2ce15d5f6f
@ -124,8 +124,10 @@ public class WidgetTypeServiceImpl implements WidgetTypeService {
|
|||||||
if (widgetsBundle == null) {
|
if (widgetsBundle == null) {
|
||||||
throw new DataValidationException("Widget type is referencing to non-existent widgets bundle!");
|
throw new DataValidationException("Widget type is referencing to non-existent widgets bundle!");
|
||||||
}
|
}
|
||||||
|
String alias = widgetType.getAlias();
|
||||||
String alias = widgetType.getName().toLowerCase().replaceAll("\\W+", "_");
|
if (alias == null || alias.trim().isEmpty()) {
|
||||||
|
alias = widgetType.getName().toLowerCase().replaceAll("\\W+", "_");
|
||||||
|
}
|
||||||
String originalAlias = alias;
|
String originalAlias = alias;
|
||||||
int c = 1;
|
int c = 1;
|
||||||
WidgetType withSameAlias;
|
WidgetType withSameAlias;
|
||||||
|
|||||||
@ -169,7 +169,10 @@ public class WidgetsBundleServiceImpl implements WidgetsBundleService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void validateCreate(WidgetsBundle widgetsBundle) {
|
protected void validateCreate(WidgetsBundle widgetsBundle) {
|
||||||
String alias = widgetsBundle.getTitle().toLowerCase().replaceAll("\\W+", "_");
|
String alias = widgetsBundle.getAlias();
|
||||||
|
if (alias == null || alias.trim().isEmpty()) {
|
||||||
|
alias = widgetsBundle.getTitle().toLowerCase().replaceAll("\\W+", "_");
|
||||||
|
}
|
||||||
String originalAlias = alias;
|
String originalAlias = alias;
|
||||||
int c = 1;
|
int c = 1;
|
||||||
WidgetsBundle withSameAlias;
|
WidgetsBundle withSameAlias;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user