-
Notifications
You must be signed in to change notification settings - Fork 41
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
[UX] Fixed: Set the default value for "Layout template" to what is in use on the default layout. #6479
Comments
I've filed a quick PR with a few line change. + if ($layout->layout_template != NULL) {
+ $layout_template = $layout->layout_template;
+ }
+ else {
+ $layout_template = config_get('layout.layout.default', 'layout_template');
+ }
$form['layout_template'] = array(
'#title' => t('Layout template'),
'#type' => 'radios',
- '#default_value' => $layout->layout_template,
+ '#default_value' => $layout_template,
'#options' => array(), |
I'm a bit surprised that there is not an existing issue for this. It's a bit of a pet peeve of mine as well. This seems like a simple and useful solution! Works for me. |
Same! It's been bothering me for so long I can't believe I hadn't created one before now :) |
Indeed, that seems like a non-brainer that should be in place from the start 👍🏼 |
I've tested this and it works like a charm! Thanks @jenlampton 🙏🏼 ...and thank you @yorkshire-pudding for the brilliant idea ❤️ I've reviewed the code and it looks good (only left a suggestion for an inline comment to be added to explain what we are doing and why). Here's what I've tested:
So this works as expected when creating new and when editing existing layouts 👍🏼 ....RTBC (minus the pending addition of the inline comment, which is totally up to you @jenlampton ) |
Comment added. I also just added tests, so no rejecting by core devs! (I hope) |
One spelling nag in the new test. ...the rest of the CSpell nags should be addressed separately in #6302 |
Fixed the spelling error, and some other PHPCS failures that seemed legit. |
@jenlampton there are some CSS changes that seem to have creeped in from your local now. |
Gah, sorry. I managed to pull those out last time and then they snuck in again. removed! |
Yeah, I think that things like that usually happen when you have not rebased/pulled. Checking again 👀 |
This is RTBC again 👍🏼 ...minus a small suggestion to use single instead of double quotes in some text. |
A big peeve of mine is forms that throw validation errors before I've finished filling them out, so I'm very happy to see this. |
If people like this change, then please review/test the PR for #6480 as well. |
Love it! |
This is such an incredibly good fix! I can't believe we've made people click an option and encounter that AJAX error for so long. Great idea @jenlampton! Thanks everyone, I've merged backdrop/backdrop#4711 into 1.x and 1.27.x. |
When you create a layout from the layouts listing page currently, you are asked for the layout template every time.
Many of us regularly forget to select a template on this step (causing an immediate validation error when we enter the path).
The reason we forget to select a template so often is because which template is in use is not even something we're thinking about -- because it's not relevant to our current task: placing blocks on the page.
This could be solved if the "Layout template" question had a default value.
@yorkshire-pudding suggested:
Yes please :)
The text was updated successfully, but these errors were encountered: