Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure currentUser exists first #14319

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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