- Issue created by @Chris Matthews
- 🇺🇸United States Chris Matthews
Alternatively:
Only the 'Save' button for each of the 4 entity types' add form
or
Only the 'Save and add fields' button for each of the 4 entity types' add form - First commit to issue fork.
- Assigned to narendraR
- Status changed to Needs work
over 1 year ago 11:50am 23 June 2023 - last update
over 1 year ago 29,482 pass, 48 fail - @narendrar opened merge request.
- last update
over 1 year ago 29,553 pass - 🇮🇳India keshav patel
Chris Matthews, Patch '3365229_8.patch' fixes the issue. Please review.
- Status changed to Needs review
over 1 year ago 6:22am 26 June 2023 - last update
over 1 year ago Custom Commands Failed - Issue was unassigned.
- last update
over 1 year ago 29,553 pass - 🇮🇳India keshav patel
Updated patch '3365229_8.patch' --> '3365229_11.patch' as per coding standards.
- 🇺🇸United States smustgrave
Issue was started in an MR on the correct branch and should continue there.
MR should be reviewed though.
- Status changed to Needs work
over 1 year ago 12:21pm 27 June 2023 - 🇺🇸United States bnjmnm Ann Arbor, MI
The changes here are pretty straightforward. Most of it is refactoring the button labels from
'Save content type'
to'Save'
which is fine to do IMO since the added "manage fields" button will provide sufficient context clues regarding what the "Save" button means.- It looks like there's a dedicated
form_alter
and submit handler for each of the relevant entity types, but the logic in each is largely the same. The alter can probably be consolidated into a single function like
function field_ui_form_alter(&$form, FormStateInterface $form_state, $form_id) { $forms = ['node_type_form', 'media_type_add_form', 'block_content_type_add_form', 'comment_type_add_form']; if (!in_array($form_id, $forms)) { return; } // We want to display the button only on add block type form. if ($form_state->getFormObject()->getEntity()->isNew()) { $form['actions']['save_continue'] = $form['actions']['submit']; $form['actions']['save_continue']['#value'] = t('Save and manage fields'); $form['actions']['save_continue']['#weight'] = $form['actions']['save_continue']['#weight'] + 5; $form['actions']['save_continue']['#submit'][] = 'field_ui_form_manage_field_form_submit'; } }
The only difference in the submit handlers (I think... double check) is a string that is available via form state, so it could be something like
function field_ui_form_manage_field_form_submit($form, FormStateInterface $form_state) { $provider = $form_state->getFormObject()->getEntity()->getEntityType()->getProvider(); if ($form_state->getTriggeringElement()['#parents'][0] === 'save_continue' && $route_info = FieldUI::getOverviewRouteInfo($provider, $form_state->getValue('id'))) { $form_state->setRedirectUrl($route_info); } }
- I didn't see any test coverage for the newly added Save and Manage Fields buttons. I imagine it can be integrated into existing tests. Just a verification that submitting it takes the user to the correct field ui form is probably sufficient.
- It looks like there's a dedicated
- last update
over 1 year ago 29,559 pass - last update
over 1 year ago 29,563 pass - Status changed to Needs review
over 1 year ago 6:45pm 28 June 2023 - last update
over 1 year ago 29,566 pass - Status changed to Needs work
over 1 year ago 4:20pm 29 June 2023 - 🇪🇸Spain ckrina Barcelona
I like the idea of separating this button in 2 so a user can decide which is the next step, but I see some problems with the current result: now there are 2 main actions, when in a form there should be only 1. For example, in the form to create a node we have the "Save" action as the primary one (with the blue Primary button styles) and then the Preview with the regular button (gray styles). So in here the Primary action should be defined so we don't have 2 blue buttons together and we "suggest" the next step highlighting the one that makes more sense.
I'm inclined to the "Save and add fields" as the primary one because this way we'd be leading a newbie to the reasonable and handy next step, but the other one would make sense too. So no strong opinion from me about which one. Just let's be sure that there is only one primary button :) - 🇳🇱Netherlands yoroy
Good call @ckrina. I'm happy to provide a strong opinion on which one to use :-D
Is the issue about inconsistencies or about workflow? Lets not fix inconsistencies by introducing workflow changes, or at least be clear about how these impact eachother :)
Not saying it wouldn't be useful to add the "and manage fields" option, but then that should probably be the only button. I notice that editing an existing content type has just "save" and that's fine. So for content types we really are in the specific context of creating a new thing that very likely needs further work in setting up fields. If the same situation (editing existing is a different screen than creating a new one) applies to creating new Comment, Media, Block types, than "Save and manage fields" could well be the only primary button there.
- last update
over 1 year ago 29,567 pass - last update
over 1 year ago 29,563 pass, 5 fail - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 29,556 pass, 1 fail - last update
over 1 year ago 29,566 pass - Status changed to Needs review
over 1 year ago 4:56pm 30 June 2023 - 🇺🇸United States Chris Matthews
Is the issue about inconsistencies or about workflow? Lets not fix inconsistencies by introducing workflow changes, or at least be clear about how these impact each other
Great comment! I originally submitted the issue with both consistency and functionality in mind, with functionality (from a site builder's perspective) taking a bit higher priority between the two. With that said, it's definitely not work fixing inconsistencies if it unintentionally causes other issues, so we may need a full review from the UX team before proceeding.
- Status changed to Needs work
over 1 year ago 8:52pm 1 July 2023 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- last update
over 1 year ago 29,571 pass - 🇳🇱Netherlands yoroy
I was initially leaning to having just the one button "Save and manage fields", but in Slack, @ckrina correctly pointed out that managing fields is not always as important a next step for media, comments. So, lets do a "Save and manage fields" as the first and primary button, "Save" as the secondary button.
- last update
over 1 year ago 29,801 pass, 2 fail - last update
over 1 year ago 29,802 pass - Status changed to Needs review
over 1 year ago 9:37am 5 July 2023 - last update
over 1 year ago 29,798 pass - Status changed to RTBC
over 1 year ago 5:44pm 5 July 2023 - 🇺🇸United States hooroomoo
Manually tested, changes look good and looks like usability review feedback is addressed so removing tag.
- last update
over 1 year ago 29,802 pass - last update
over 1 year ago 29,802 pass - Status changed to Fixed
over 1 year ago 12:38pm 6 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.