|
|
|
@ -80,6 +80,11 @@ async function reuseOrSave(
|
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const nc_sanitizeName = (name) => { |
|
|
|
|
// replace all special characters by _
|
|
|
|
|
return name.replace(/\W+/g, '_').trim(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
@Injectable() |
|
|
|
|
export class ColumnsService { |
|
|
|
|
constructor( |
|
|
|
@ -127,6 +132,10 @@ export class ColumnsService {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!isVirtualCol(param.column)) { |
|
|
|
|
param.column.column_name = nc_sanitizeName(param.column.column_name); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
!isVirtualCol(param.column) && |
|
|
|
|
!(await Column.checkTitleAvailable({ |
|
|
|
@ -1045,6 +1054,10 @@ export class ColumnsService {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!isVirtualCol(param.column)) { |
|
|
|
|
param.column.column_name = nc_sanitizeName(param.column.column_name); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
!isVirtualCol(param.column) && |
|
|
|
|
!(await Column.checkTitleAvailable({ |
|
|
|
|