Merge pull request #5283 from JunaidJaved248/master

SKU Validation Optimization Issue #5279 Fixed
This commit is contained in:
Devansh 2021-10-29 09:11:45 +05:30 committed by GitHub
commit b51595e6a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/admin.js": "/js/admin.js?id=8bcdcf3b86191d1739a5",
"/css/admin.css": "/css/admin.css?id=4ed7566377c765482303"
"/js/admin.js": "/js/admin.js?id=ae36592d7fe4c08e0c59",
"/css/admin.css": "/css/admin.css?id=a3682f955940638778fc"
}

View File

@ -88,7 +88,7 @@
<div class="control-group" :class="[errors.has('sku') ? 'has-error' : '']">
<label for="sku" class="required">{{ __('admin::app.catalog.products.sku') }}</label>
<input type="text" v-validate="{ required: true, regex: /^[a-z0-9]+(?:-[a-z0-9]+)*$/ }" class="control" id="sku" name="sku" value="{{ request()->input('sku') ?: old('sku') }}" data-vv-as="&quot;{{ __('admin::app.catalog.products.sku') }}&quot;"/>
<input type="text" v-validate="{ required: true, regex: /^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$/ }" class="control" id="sku" name="sku" value="{{ request()->input('sku') ?: old('sku') }}" data-vv-as="&quot;{{ __('admin::app.catalog.products.sku') }}&quot;"/>
<span class="control-error" v-if="errors.has('sku')">@{{ errors.first('sku') }}</span>
</div>

View File

@ -1 +1 @@
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $product[$attribute->code] }}" {{ in_array($attribute->code, ['sku', 'url_key']) ? 'v-slugify' : '' }} data-vv-as="&quot;{{ $attribute->admin_name }}&quot;" {{ $attribute->code == 'name' && ! $product[$attribute->code] ? 'v-slugify-target=\'url_key\'' : '' }} />
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $product[$attribute->code] }}" {{ in_array($attribute->code, ['url_key']) ? 'v-slugify' : '' }} data-vv-as="&quot;{{ $attribute->admin_name }}&quot;" {{ $attribute->code == 'name' && ! $product[$attribute->code] ? 'v-slugify-target=\'url_key\'' : '' }} />

View File

@ -15,7 +15,7 @@ class Slug implements Rule
*/
public function passes($attribute, $value)
{
return preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/', $value);
return preg_match('/^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$/', $value);
}
/**