Problem/Motivation
Drupal.org will let you create projects namespaces that are not valid machine names.
Proposed resolution
Since the consequences of a bad namespace choice may not be obvious to new contributors and it's so painful to fix once a project has gained any momentum, we should enforce important constraints through validation when creating or promoting a project rather than leaving it up to chance.
Remaining tasks
- Identify the constraints. So far:
- Enforce them in form validations.
User interface changes
tbd
API changes
tbd
Original report by @Marcin Pajdzik
I set the url for my module to eu-cookie-compliance. However I should have used underscores rather than hyphens so that it reads eu_cookie_compliance.
The problem is that now if I do drush dl eu-cookie-compliance the module is downloaded but then when I wand to enable it with drush en eu-cookie-compliance, drush cannot find it.
Is that possible to change it?
Comment | File | Size | Author |
---|
Comments
Comment #1
rsvelko CreditAttribution: rsvelko commentedcome on guys - that one should be simple
What would the d.o. webmasters suggest ?
Comment #2
gregglesIt's actually not easy which is why the page before you create/promote is so explicit about how hard it is (see attachments).
This is basically at the whim of someone with 1) advanced access to the site server 2) knowledge about all the places this touches and how to make the changes properly. I don't have #2 and may not even have all of #1.
Sorry :(
Comment #3
Gerhard Killesreiter CreditAttribution: Gerhard Killesreiter commentedSuggestion: delete project and create a new one.
Comment #4
rsvelko CreditAttribution: rsvelko commentedfor the momment this might be our best choice - to delete and recreate the project.
For the future - lets make it so that on d.o. the shortname/shortcode/machine-readable-project-name gets scanned on creation for illegal characters like '-'-s (dashes) and so make it impossible for this problem to occur...
Any suggestions of what to do to change this ? Update a module on d.o. ? Which module ? Where to patch it ? Or if no patch is needed and its just a site setting - whom to contact to change that setting ?
Or is this whole thing "by design" ? A design in which dashes are allowed is bad !
I am an optimist.
Comment #5
gregglesSure, let's make this a feature request.
In an ideal world, project would look at any associated repository and guess the proper name. Barring that, maybe it can just make sure there are no hyphens in the short name. If this is something that is d.o specific I guess we should either move it to drupalorg module or make it validation in a variable of some sort so it can be disabled elsewhere.
Comment #6
rsvelko CreditAttribution: rsvelko commentedis the project.module used on d.o. to handle those things? If so lets patch the project module with some more options ...
Comment #7
greggles@rsvelko yes, that's why I moved this to the project module queue, because it needs to be updated (if the maintainers there agree it's an appropriate feature). If it's too drupalorg specific it should be moved to drupalorg module.
Comment #8
dwwThe furthest I'd go in Project for this would be #1189292: Let enforce lower case names for new projects . But Project itself doesn't care if your project machine name works as a valid Drupal module machine name. That's a job for a drupalorg-specific customization.
That said, I agree it'd be nice if we were enforcing this.
Note: there are two forms you're going to want to inject a custom validation callback on:
- The project node add/edit form
- The form when a project is promoted from a sandbox to full
Cheers,
-Derek
Comment #9
itapplication CreditAttribution: itapplication commentedI test site (git7site.devdrupal.org) for project short name validation functionality. It's allow to use project short name being start with digit.
Drupal projects for module and themes do not allow to use name which start with digit. So project validation functionality also trap and disallow short project name start with digit.
This shouldn't allow -
https://git7site.devdrupal.org/project/2
https://git7site.devdrupal.org/project/2two
This is OK -
https://git7site.devdrupal.org/project/two2
Comment #10
itapplication CreditAttribution: itapplication commentedTagging.
Appropriate tag help to flash issue in a right queue/search result.
Comment #11
itapplication CreditAttribution: itapplication commentedTagging
Comment #12
itapplication CreditAttribution: itapplication commentedSorry for typo mistake.
Comment #13
itapplication CreditAttribution: itapplication commentedTesting for this issue. Unfortunately there is no work around for this issue at new D7.
https://git7site.devdrupal.org/project/0zero
Comment #14
drummThe "Drupal.org D7" tag is for launch blockers. Since this isn't a regression, it is not a blocker.
"drupal.org redesign" and "drupal.org redesign qa" tags are for a previous initiative, https://drupal.org/community-initiatives/redesign. I don't think anyone is watching them.
Moving to version 7.x-3.x since this should be fixed in D7 first, and probably not backported since we are nearing launch.
If any developers want to take this on, #8 has the specific forms to target, see https://drupal.org/node/1018084.
Comment #15
hass CreditAttribution: hass commentedI do not see any usefull information here. Why are we not just enable field_validation module and validate the project name with a regex. #2132845: Disallow hyphen in project short names lists at least 3 projects and there are a lot more with hyphens.
Things are getting more worse with every day and this is just drush en field_validation and one easy config.
Comment #16
itapplication CreditAttribution: itapplication commented@hass , I agree with you "...Things are getting more worse with every day."
List of bad project name is continuously increasing.
Comment #17
TravisCarden CreditAttribution: TravisCarden commentedComment #18
dwwThis was resolved via #2172891: Validate allowed characters on project's machine name