Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
custom_field-3486241
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
custom_field-3486241
Commits
2d06a768
Commit
2d06a768
authored
10 months ago
by
Andy Marquis
Browse files
Options
Downloads
Patches
Plain Diff
Fixes
#3421649
unable to add additional fields.
parent
d3c0f876
No related branches found
Branches containing commit
Tags
8.x-2.0-alpha3
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/Field/FieldType/CustomItem.php
+14
-11
14 additions, 11 deletions
src/Plugin/Field/FieldType/CustomItem.php
with
14 additions
and
11 deletions
src/Plugin/Field/FieldType/CustomItem.php
+
14
−
11
View file @
2d06a768
...
...
@@ -215,14 +215,9 @@ class CustomItem extends FieldItemBase {
'#description'
=>
$this
->
t
(
'These can be re-ordered on the main field settings form after the field is created'
),
'#prefix'
=>
'<div id="'
.
$wrapper_id
.
'">'
,
'#suffix'
=>
'</div>'
,
'#states'
=>
[
'visible'
=>
[
'select[data-id="custom-field-storage-clone"]'
=>
[
'value'
=>
''
],
],
],
'actions'
=>
[
'#type'
=>
'actions'
,
],
],
'actions'
=>
[
'#type'
=>
'actions'
,
],
];
...
...
@@ -261,6 +256,12 @@ class CustomItem extends FieldItemBase {
'#prefix'
=>
'<div class="messages messages--warning" role="alert" style="display: block;">'
,
'#suffix'
=>
'</div>'
,
];
// Add states to items.
$element
[
'items'
][
'#states'
]
=
[
'visible'
=>
[
'select[data-id="custom-field-storage-clone"]'
=>
[
'value'
=>
''
],
],
];
}
}
...
...
@@ -432,12 +433,14 @@ class CustomItem extends FieldItemBase {
'callback'
=>
[
$this
,
'actionCallback'
],
'wrapper'
=>
$wrapper_id
,
],
'#states'
=>
[
];
if
(
!
empty
(
$sources
))
{
$element
[
'actions'
][
'add'
][
'#states'
]
=
[
'visible'
=>
[
'select[data-id="custom-field-storage-clone"]'
=>
[
'value'
=>
''
],
],
]
,
];
]
;
}
}
$form_state
->
setCached
(
FALSE
);
...
...
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