Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
shortcut.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jan 2015 at 10:16 UTC
Updated:
18 Feb 2015 at 13:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
geertvd commentedComment #2
geertvd commentedComment #4
alexpottI imagined that the fix would be more like this.
We also need to add a test to ensure we don't break this again.
Comment #6
alexpottAdded a test and fixed the test the got broke.
Comment #8
geertvd commentedLooks good, I agree doing the sort in
getShortcutsis a better solution then what I came up with.Test looks good also.
Comment #9
amateescu commentedWouldn't it look better if we put this in the ShortcutSet class?
Comment #12
alexpottre #9 I think sorting of shortcuts should be handled by the Shortcut entity. Setting back to rtbc as per #8
Comment #13
amateescu commentedThe $shortcuts array passed to the new sort() method is basically a shortcut set. Isn't it semantically correct that we're sorting a set of shortcuts, hence ShortcutSet::sort()?
By the reasoning in #12, should we move getShortcuts() to the Shortcut class as well?
Comment #14
geertvd commentedShouldn't new sort() function just contain the comparison function and the uasort be done in getShortcuts().
Something like this:
and then getShortcuts() should be this
This seems more consistent with what other core modules are doing.
Comment #15
alexpott@geertvd I thought about doing it that way too... I copied
Language::sort. If you think that is better then go for it. I concede it is more flexible :)Comment #16
geertvd commentedAs discussed.
Comment #17
amateescu commentedThese are ShortcutInterface objects, not arrays :)
Comment #18
geertvd commentedComment #19
amateescu commentedCool, thanks!
Comment #21
catchCommitted/pushed to 8.0.x, thanks!
Comment #22
wim leersHURRAY! Shortcut Sanity!