Skip to content

Commit

Permalink
Merge pull request #14319 from craftcms/bugfix/14316-fields-autofocus…
Browse files Browse the repository at this point in the history
…-param-adjustment

ensure currentUser exists first
  • Loading branch information
brandonkelly authored Feb 7, 2024
2 parents 7008e37 + bf8febd commit ea5fa4d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Fixed a SQL error that could occur when querying relations with `eagerly()`.
- Fixed a bug where element actions weren’t working for elements that were added to a relational field.
- Fixed a bug where very wide tables could bleed off the page.
- Fixed an error that occurred when activating a new user. ([#14316](https://github.com/craftcms/cms/issues/14316))

## 5.0.0-alpha.13 - 2024-02-06

Expand Down
2 changes: 1 addition & 1 deletion src/templates/_includes/forms/autosuggest.twig
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ new Vue({
name: (name ?? '')|namespaceInputName,
size: size ?? '',
maxlength: maxlength ?? '',
autofocus: (autofocus ?? false) and currentUser.getAutofocusPreferred() and not craft.app.request.isMobileBrowser(true),
autofocus: (autofocus ?? false) and currentUser and currentUser.getAutofocusPreferred() and not craft.app.request.isMobileBrowser(true),
disabled: disabled ?? false,
title: title ?? '',
placeholder: placeholder ?? '',
Expand Down
2 changes: 1 addition & 1 deletion src/templates/_includes/forms/text.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
name: name ?? false,
value: value ?? false,
maxlength: maxlength ?? false,
autofocus: (autofocus ?? false) and currentUser.getAutofocusPreferred() and not craft.app.request.isMobileBrowser(true),
autofocus: (autofocus ?? false) and currentUser and currentUser.getAutofocusPreferred() and not craft.app.request.isMobileBrowser(true),
autocomplete: autocomplete is boolean ? (autocomplete ? 'on' : 'off') : autocomplete,
autocorrect: (autocorrect ?? true) ? false : 'off',
autocapitalize: (autocapitalize ?? true) ? false : 'none',
Expand Down

0 comments on commit ea5fa4d

Please sign in to comment.