Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As #1892016: Random test failure in Drupal\rest\Tests\Views\StyleSerializerTest pointed out you don't want to have all kind of strings accepted for the field alias.
Let's allow "-,_" and numbers/Chars.
Comment | File | Size | Author |
---|---|---|---|
#18 | drupal-1892158-18.patch | 3.52 KB | dawehner |
#18 | interdiff.txt | 1.09 KB | dawehner |
#14 | drupal-1892158-14.patch | 3.59 KB | dawehner |
#14 | interdiff.txt | 1.9 KB | dawehner |
#11 | drupal-1892158-11.patch | 3.56 KB | dawehner |
Comments
Comment #1
dawehnerUpdate.
Comment #2
damiankloip CreditAttribution: damiankloip commentedRerolled, and also just removed the passing by reference in the validation method signature. Would do an interdiff by this is just one character/line :) Although the serialization would handle any of these characters that aren't allowed, consistency is better for sure.
Anything to excise these crazy random test failures is a win IMO, So Happy with this patch.
Comment #4
dawehner#2: 1892158-2.patch queued for re-testing.
Comment #6
dawehnerMaybe that? Alternative we could just hardcode the wrong characters.
Comment #8
olli CreditAttribution: olli commented32-64 includes 0-9 and - (48).
Comment #9
dawehnerDoes 91 to 96 work better?
Comment #11
dawehnerThe concentration seems to go away :)
Comment #12
klausiThere is no validation function already for that in core? We cannot use form_validate_machine_name(), but is there nothing else? I suggest you add element_validate_machine_name() to form.inc.
$random_name_2 is a bad variable name, use $invalid_name instead?
Comment #13
dawehnerSo the problem here is that we allow more then machine names, because you want to be able to configure more then machine names in the XML document,
just for example an xml document might want camelCase variables.
Comment #14
dawehnerThanks for reviewing!
Fixed the second part of the review.
Comment #15
olli CreditAttribution: olli commented_ = 95. Thanks for clarifying why not only machine name. Why only these characters then? I checked the previous issue but could not crack it.
Comment #16
dawehnerTo be honest I just though that these kind of characters would make sense as XML tags, but I'm open for different ones.
Comment #17
olli CreditAttribution: olli commentedOk. Tiny change in range to prevent random failures and we are good.
Comment #18
dawehnerDecided to put just a single string in there, as it's much easier to read then.
Comment #19
damiankloip CreditAttribution: damiankloip commentedYeah, that is much better IMO. I tihnk this is ready again?
Comment #20
catchLooks reasonable. Committed/pushed to 8.x. Not sure why this was posted as a feature request.
Comment #22
guilmour-asc CreditAttribution: guilmour-asc as a volunteer commentedExcuse me, but I need to know if it would be too dangerous for the alias to allow dots [ . ] and colons [ : ].
I'm trying to expose my data in Dublin Core style, and its terms are segemented by dots or double-dots (ex.: dc.title, dc.identifier.uri).