This select list appears on admin/config/system/actions page.

Currently it looks like this:

Proposed resolution

  1. Change default empty option from "Choose an advanced action" to "- Select -" to make it look different from other options.
  2. Sort options alphabetically.
  3. Place the select list and button above the actions table.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chi created an issue. See original summary.

xjm’s picture

Those all sound like good improvements to me; thanks @Chi.

Chi’s picture

Issue tags: +Novice

Looks like a perfect novice task.

yoroy’s picture

Issue tags: -Needs usability review

Thanks for opening this followup.

Agreed these 3 are all useful improvements to implement.

arunkumark’s picture

Status: Active » Needs review
FileSize
1.85 KB
116.8 KB

I have patched for above issue.

Actions

Chi’s picture

+++ b/core/modules/action/src/Form/ActionAdminManageForm.php
@@ -57,6 +57,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
+    sort($actions); // Sort options in ascending.

Sort is not proper choice here because it does not maintain index association. It is not possible to create an action with this select list. Also note that Drupal coding standards do not allow comments to appear after statements. For this particular case this comment seems redundant because the goal of this function is pretty obvious.

Chi’s picture

Status: Needs review » Needs work
arunkumark’s picture

Status: Needs work » Needs review
FileSize
1.86 KB

@Chi thanks for the suggestions. As per your comment, i have updated the sorting mechanism as asort(Sort an array and maintain index association).

Chi’s picture

+++ b/core/modules/action/src/Form/ActionAdminManageForm.php
@@ -57,6 +57,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
+    // Sort options array in ascending.
+    asort($actions);

@arunkumark, I am still thinking that commenting such trivial things is not needed.

yoroy’s picture

Status: Needs review » Needs work

Lets remove that comment then :)

arunkumark’s picture

Status: Needs work » Needs review
FileSize
1.82 KB

The patch was re-rolled with comment cleanup.

Chi’s picture

Status: Needs review » Reviewed & tested by the community

Thanks.

  • xjm committed d4006a6 on 8.5.x
    Issue #2917916 by arunkumark, Chi, yoroy: Improve usability of create...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Nice work! The form is easier to understand now.

Committed and pushed to 8.5.x. I didn't backport it to 8.4.x since it's a UI change. Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.