Closed (fixed)
Project:
Drupal core
Version:
8.4.x-dev
Component:
workflows.module
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Aug 2017 at 10:49 UTC
Updated:
23 Oct 2017 at 11:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
timmillwoodComment #3
meenakshig commentedchanged array_map to array_column. please let me know is it correct ?
Comment #4
meenakshig commentedsorry my previous patch arraycolumn_2902018_1.patch was not correct i have changed array_map to array_column only in one place so here i have changed it where ever possible
Comment #5
amateescu commented@Meenakshi Gupta, the array_column() function is not a direct replacement for array_map(), they do entirely different things :) I linked each of them to their documentation on php.net so you can see exactly how they should be used.
Comment #6
amateescu commentedMaybe the issue title was confusing...
Comment #7
meenakshig commented@amateescu thanks for clarifying :)
Comment #8
meenakshig commentedComment #9
harsha012 commentedDo we need to change all the array_map() to array_column() in the workflow module ?
i have fixed the array_column() syntax in WorkflowAddForm.php
Comment #10
timmillwoodNot all array_map() functions make sense to move to array_column(), but if they do I say lets change them.
These should be on the same line.
Comment #11
harsha012 commentedfixed as per #10
Comment #12
timmillwoodI don't think we can change the calls to
\Drupal\workflows\State::labelCallback, this doesn't return "label", it returns the label of a state.Please provide an interdiff with patches. https://www.drupal.org/documentation/git/interdiff
Comment #14
harsha012 commentedinterdiff
Comment #16
vijaycs85I don't think it makes sense to update any place other than addForm and current patch needs a change to make machinename/id as key:
Comment #17
sam152 commentedYup, none of these can use array_column because they are a method call on an object, not accessing an array value.
@vijaycs85 is also correct, the third param should be 'id' to be used as the array key.
Comment #18
vijaycs85Thanks for confirming @Sam152. Here is a patch.
Comment #19
sam152 commentedLooks good to me.
Comment #20
larowlanCrediting @Sam152, @timmillwood and @amateescu for reviews and mentoring.
Comment #23
larowlanCommitted as 4210adf and pushed to 8.5.x.
Cherry-picked as 73fd8e2 and pushed to 8.4.x.