Skip to content

Commit

Permalink
Respect allowUppercaseInSlug in the CP
Browse files Browse the repository at this point in the history
Fixes #4330
  • Loading branch information
brandonkelly committed May 30, 2019
1 parent 85ae4c9 commit 9a0729b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Fixed a bug where publishing a Single entry’s draft, or reverting a Single entry to a prior version, would overwrite its title to the section name. ([#4323](https://github.com/craftcms/cms/pull/4323))
- Fixed a bug where Craft wasn’t invalidating existing asset transforms when changing the dimensions of a named transform.
- Fixed a bug where `craft\services\Fields::getFieldsByElementType()` would return duplicate results if a field was used in more than one field layout for the element type. ([#4336](https://github.com/craftcms/cms/issues/4336))
- Fixed a bug where Craft wasn’t respecting the `allowUppercaseInSlug` config setting when generating slugs in the Control Panel. ([#4330](https://github.com/craftcms/cms/issues/4330))

## 3.1.28 - 2019-05-21

Expand Down
1 change: 1 addition & 0 deletions src/web/assets/cp/CpAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ private function _craftData(): array
$data = [
'actionTrigger' => $generalConfig->actionTrigger,
'actionUrl' => UrlHelper::actionUrl(),
'allowUppercaseInSlug' => (bool)$generalConfig->allowUppercaseInSlug,
'asciiCharMap' => StringHelper::asciiCharMap(true, Craft::$app->language),
'baseCpUrl' => UrlHelper::cpUrl(),
'baseSiteUrl' => UrlHelper::siteUrl(),
Expand Down
6 changes: 4 additions & 2 deletions src/web/assets/cp/dist/js/Craft.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! - 2019-05-14 */
/*! - 2019-05-30 */
(function($){

/** global: Craft */
Expand Down Expand Up @@ -16982,7 +16982,9 @@ Craft.SlugGenerator = Craft.BaseInputGenerator.extend(
sourceVal = sourceVal.replace(/['"‘’“”\[\]\(\)\{\}:]/g, '');

// Make it lowercase
sourceVal = sourceVal.toLowerCase();
if (!Craft.allowUppercaseInSlug) {
sourceVal = sourceVal.toLowerCase();
}

if (Craft.limitAutoSlugsToAscii) {
// Convert extended ASCII characters to basic ASCII
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/js/Craft.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/js/Craft.min.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/web/assets/cp/src/js/SlugGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Craft.SlugGenerator = Craft.BaseInputGenerator.extend(
sourceVal = sourceVal.replace(/['"\[\]\(\)\{\}:]/g, '');

// Make it lowercase
sourceVal = sourceVal.toLowerCase();
if (!Craft.allowUppercaseInSlug) {
sourceVal = sourceVal.toLowerCase();
}

if (Craft.limitAutoSlugsToAscii) {
// Convert extended ASCII characters to basic ASCII
Expand Down

0 comments on commit 9a0729b

Please sign in to comment.