Maxlength attribute on macro name
This commit is contained in:
committed by
Sebastiaan Janssen
parent
0e3f324cb0
commit
088abae314
@@ -19,7 +19,8 @@
|
||||
</div>
|
||||
|
||||
<umb-control-group label="@macro_enterMacroName" hide-label="false">
|
||||
<input type="text" name="itemKey" ng-model="vm.itemKey" class="umb-textstring textstring input-block-level" umb-auto-focus required />
|
||||
<input type="text" name="itemKey" ng-model="vm.itemKey" class="umb-textstring textstring input-block-level"
|
||||
umb-auto-focus required maxlength="255" />
|
||||
</umb-control-group>
|
||||
|
||||
<button type="submit" class="btn btn-primary"><localize key="general_create">Create</localize></button>
|
||||
|
||||
@@ -62,6 +62,11 @@ namespace Umbraco.Web.Editors
|
||||
return this.ReturnErrorResponse("Macro with this alias already exists");
|
||||
}
|
||||
|
||||
if (name == null || name.Length > 255)
|
||||
{
|
||||
return this.ReturnErrorResponse("Name cannnot be more than 255 characters in length.");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var macro = new Macro
|
||||
@@ -149,6 +154,11 @@ namespace Umbraco.Web.Editors
|
||||
return this.ReturnErrorResponse($"No macro data found in request");
|
||||
}
|
||||
|
||||
if (macroDisplay.Name == null || macroDisplay.Name.Length > 255)
|
||||
{
|
||||
return this.ReturnErrorResponse("Name cannnot be more than 255 characters in length.");
|
||||
}
|
||||
|
||||
var macro = _macroService.GetById(int.Parse(macroDisplay.Id.ToString()));
|
||||
|
||||
if (macro == null)
|
||||
|
||||
Reference in New Issue
Block a user