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.
I think this is wanted, or should we manually convert project machine names to generate urls?
i.e. project_git_instructions is using it to make "Version Control" tab link on the projects pages.
Comment | File | Size | Author |
---|---|---|---|
#19 | 2172891-19.patch | 1.58 KB | valthebald |
#17 | 2172891-17.patch | 1.65 KB | valthebald |
#10 | 2172891-validate-shortname-10.patch | 1.01 KB | valthebald |
#8 | 2172891-8.png | 3.84 KB | valthebald |
#8 | 2172891-validate-shortname-8.patch | 1.01 KB | valthebald |
Comments
Comment #1
tvn CreditAttribution: tvn commentedComment #2
drummSpaces should not be allowed.
Comment #3
valthebaldComment #4
valthebaldI assume this will need a test
Comment #5
valthebaldHere's the patch that solves the issue.
It needs a test, but since most tests are switched off for project.module, I'd rather create a followup issue for that
Comment #6
valthebaldComment #7
drummThe error message should be a complete sentence, with punctuation. And more friendly — what's an incorrect symbol? Should follow the function naming, from http://www.php.net/manual/en/functions.user-defined.php:
Comment #8
valthebaldValidation rule and error message changed per #7.
Error message after applying patch #8:
Comment #9
drummLooks like the condition is reversed. Valid names get the error.
Comment #10
valthebaldMy bad, of course it is
Comment #12
drummLooks good. Committed & deploying.
Comment #13
tvn CreditAttribution: tvn commentedwohoo! thanks valthebald!
Comment #15
drummReverting because of #2227791: Project page error: Short name must follow PHP naming convention.
Comment #16
drummLet's actually move this to drupalorg. Project module should be a bit generic, it could be used for non-PHP project anyway.
This validation should run only for full projects.
Comment #17
valthebaldHere's the patch against drupalorg
Comment #18
drummSorry I didn't put this detail in earlier, I was in a hurry.
This should go in
drupalorg_project_form_node_form_alter()
, withinThe project node type shouldn't be hard-coded since modules, themes, etc are actually separate node types.
Comment #19
valthebaldChanged per #18
Comment #21
drummLooks good. Will deploy today.
Comment #22
drummNow deployed to Drupal.org.
Comment #23
dwwGlad to see this resolved, and for the validation to be in drupalorg_project, not project.module itself. It was originally discussed in #1561458: Require project node machine names to be valid Drupal module/theme machine names, but since all the Git commits point here I marked that one duplicate (even though it was the older issue).
Thanks everyone!
-Derek