Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
asset library system
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Oct 2015 at 11:55 UTC
Updated:
22 May 2018 at 12:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wim leersComment #3
wim leersBetter title.
Comment #4
wim leersComment #5
wim leersThe fact that this is merely a developer's mistake means this is not actually a bug, but a task.
Comment #7
fabianx commentedGiven the test fails in HEAD, I think it is a bug?
Comment #8
wim leersI think all those failures are due to one and the same bug.
Comment #9
dawehnerI'm curious whether we could create a better asertion message. Many drupal developers are coming from backgrounds which might not be familiar with the property of sets you deal with here.
Comment #10
wim leersI think we can assume developers know one of the most basic data structures, that are even part of primary school math. I might be mistaken though.
Comment #11
fabianx commentedI tend to agree that set is pretty okay as error message, but better ideas welcome :).
Comment #12
catchAgreed with the other committers that this is an RC target, however:
1. Can we split adding the assert() to another issue, and leave this for the bug fix.
2. The test coverage looks incomplete?
Comment #13
xjmComment #16
wim leersSince this is no longer an RC target, I think it no longer makes sense to split this up.
Comment #17
catchIf it goes into 8.3.x yeah.
Comment #18
wim leersOf course.
Comment #19
alexpottThe assertion message doesn't seem to reflect what is being checked.
We use $this->setExpectedException() now..
Comment #20
dawehnerDoes it not? A set is a thing where each element is unique.
Comment #21
wim leersComment #23
catchI think it's worth some redundancy in the assertion method. There are dozens of colloquial meanings of 'set' in English, including things like 'set of cutlery' or 'chess set' which explicitly have duplicate items. So I'd go for "$libraries must be a unique set" or something more explicit.
Comment #24
wim leers"unique set" makes no sense at all.
What about:
$libraries must be a set data structure?So, this: https://en.wikipedia.org/wiki/Set_(abstract_data_type). Funny enough, no set in SPL: http://php.net/manual/en/spl.datastructures.php.
Comment #27
wim leers@catch? :)
Comment #29
borisson_I think
$libraries can't contain duplicate items.as an error message clearly states the intent without getting into semantics and helps developers understand what they need to do to resolve this.Comment #30
borisson_Comment #31
dawehnerI agree, this is a way nicer error message!
Comment #32
catchCommitted 60c25e5 and pushed to 8.6.x. Thanks!
Comment #34
wim leersI thought this went in a long time ago! 😅 Thanks @borisson_ for pushing it to completion!
Comment #36
catchThe assert is using the format deprecated in 7.2, so we need to update this one.
Comment #37
borisson_I think this satisfies #36.
Comment #38
fabianx commentedYep, back to RTBC
Comment #39
alexpottCommitted b8c09be and pushed to 8.6.x. Thanks!
Comment #41
alexpottOnly put in 8.6.x because we're just adding an assertion.
Comment #42
wim leersWFM 👍