Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
drupalorg
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupalorg
Commits
347f751f
Commit
347f751f
authored
2 months ago
by
Neil Drumm
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3491859
: Update project name restrictions to follow GitLab
parent
5ca13f29
No related branches found
No related tags found
1 merge request
!312
Issue # 3494493: Documentation: Document Maintainer Widget
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drupalorg_project/drupalorg_project.module
+5
-3
5 additions, 3 deletions
drupalorg_project/drupalorg_project.module
with
5 additions
and
3 deletions
drupalorg_project/drupalorg_project.module
+
5
−
3
View file @
347f751f
...
...
@@ -1865,13 +1865,15 @@ function drupalorg_maintainers_json($project) {
* @see drupalorg_project_form_node_form_alter()
* @see https://www.php.net/manual/en/functions.user-defined.php
* @see https://www.drupal.org/node/2172891
* @see https://docs.gitlab.com/ee/user/reserved_names.html
*/
function
drupalorg_project_machine_name_validate
(
$element
,
&
$form_state
,
$form
)
{
if
((
$form
[
'#id'
]
===
'project-promote-project-form'
||
!
isset
(
$form_state
[
'values'
][
'field_project_type'
][
LANGUAGE_NONE
][
0
][
'value'
])
||
$form_state
[
'values'
][
'field_project_type'
][
LANGUAGE_NONE
][
0
][
'value'
]
==
'full'
)
&&
!
preg_match
(
'/^[a-zA-Z
_
][a-zA-Z0-9_]*$/'
,
$element
[
'#value'
]))
{
form_error
(
$element
,
t
(
'@title must follow <a href="@url">PHP naming convention</a>
.'
,
a
rray
(
&&
!
(
preg_match
(
'/^[a-zA-Z][a-zA-Z0-9_]*$/'
,
$element
[
'#value'
])
&&
preg_match
(
'/[a-zA-Z0-9]$/'
,
$element
[
'#value'
]))
)
{
form_error
(
$element
,
t
(
'@title must follow <a href="@url">PHP naming convention</a>, a
nd can not start or end with a special character.'
,
[
'@title'
=>
$element
[
'#title'
],
'@url'
=>
'https://www.php.net/manual/en/functions.user-defined.php'
)));
'@url'
=>
'https://www.php.net/manual/en/functions.user-defined.php'
,
]));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment