Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
schemadotorg
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
schemadotorg
Merge requests
!166
Resolve
#3455132
"Improve custom field"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve
#3455132
"Improve custom field"
issue/schemadotorg-3455132:3455132-improve-custom-field
into
1.0.x
Overview
0
Commits
1
Pipelines
2
Changes
2
Merged
Jacob Rockowitz
requested to merge
issue/schemadotorg-3455132:3455132-improve-custom-field
into
1.0.x
11 months ago
Overview
0
Commits
1
Pipelines
2
Changes
2
Expand
Closes
#3455132
0
0
Merge request reports
Compare
1.0.x
version 1
440a7365
11 months ago
1.0.x (base)
and
latest version
latest version
440a7365
1 commit,
11 months ago
version 1
440a7365
1 commit,
11 months ago
2 files
+
73
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/SchemaDotOrgMappingManager.php
+
16
−
1
Options
@@ -100,7 +100,22 @@ class SchemaDotOrgMappingManager implements SchemaDotOrgMappingManagerInterface
// Apply custom properties defaults.
if
(
isset
(
$defaults
[
'properties'
]))
{
foreach
(
$defaults
[
'properties'
]
as
$property_name
=>
$property
)
{
foreach
(
$defaults
[
'properties'
]
as
$property_name
=>
&
$property
)
{
// Check custom properties/fields and set defaults values.
if
(
!
$this
->
schemaTypeManager
->
hasProperty
(
$schema_type
,
$property_name
))
{
if
(
!
is_array
(
$property
))
{
throw
new
\Exception
(
sprintf
(
"Custom '%s' property/field is not defined."
,
$property_name
));
}
$property
+=
[
'type'
=>
'string'
,
'name'
=>
strtolower
(
$property_name
),
'label'
=>
$property_name
,
'description'
=>
''
,
'unlimited'
=>
FALSE
,
'required'
=>
FALSE
,
];
}
if
(
$property
===
FALSE
)
{
// Unset the name to not have the property added.
$mapping_defaults
[
'properties'
][
$property_name
][
'name'
]
=
''
;
Loading