Problem/Motivation

Spun off from #2886567: Adding a workflow state or transition with an integer ID results in unrecoverable fatal errors.

Looking at both callers of WorkflowTypeBase:: labelWeightMultisort(), the method receives an array of objects with a meaningful key, the state or transition or ID, but the docs do not indicate this.

Proposed resolution

Add documentation clarifying what the keys are.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm created an issue. See original summary.

xjm’s picture

Status: Active » Needs review
FileSize
1.05 KB

Status: Needs review » Needs work

The last submitted patch, 2: workflow-sort-docs.patch, failed testing. View results

xjm’s picture

FileSize
1009 bytes

Ehm, with less syntax error.

xjm’s picture

Status: Needs work » Needs review
amateescu’s picture

+++ b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php
@@ -270,10 +270,12 @@ public function getTransitions(array $transition_ids = NULL) {
+   *   An array of state or transition objects to multi-sort, keyed by the
+   *     state or transition ID.
...
+   *   An array of sorted transitions or states, keyed by the state or
+   *     transition ID.

I think that we only need the extra spaces on the second line only for @todo descriptions, so they can be removed here.

xjm’s picture

Right you are.

Sam152’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: 2906879-7.patch, failed testing. View results

Sam152’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
1005 bytes

  • catch committed 2d01824 on 8.5.x
    Issue #2906879 by xjm, Sam152: WorkflowTypeBase:: labelWeightMultisort...

  • catch committed 9837552 on 8.4.x
    Issue #2906879 by xjm, Sam152: WorkflowTypeBase:: labelWeightMultisort...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.5.x and cherry-picked to 8.4.x. Thanks!

Status: Fixed » Closed (fixed)

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