Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
entity_hierarchy-3283504
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
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
entity_hierarchy-3283504
Commits
fdb1fb92
Commit
fdb1fb92
authored
8 years ago
by
Lee Rowlands
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2863534
by larowlan: Prevent selection of parents that user has no access to
parent
dbf171f9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/Field/FieldWidget/EntityReferenceHierarchyAutocomplete.php
+8
-0
8 additions, 0 deletions
...ield/FieldWidget/EntityReferenceHierarchyAutocomplete.php
with
8 additions
and
0 deletions
src/Plugin/Field/FieldWidget/EntityReferenceHierarchyAutocomplete.php
+
8
−
0
View file @
fdb1fb92
...
...
@@ -5,6 +5,7 @@ namespace Drupal\entity_hierarchy\Plugin\Field\FieldWidget;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Field\FieldItemListInterface
;
use
Drupal\Core\Field\Plugin\Field\FieldWidget\EntityReferenceAutocompleteWidget
;
use
Symfony\Component\Validator\ConstraintViolationInterface
;
/**
* Widget that uses autocomplete.
...
...
@@ -21,6 +22,13 @@ use Drupal\Core\Field\Plugin\Field\FieldWidget\EntityReferenceAutocompleteWidget
class
EntityReferenceHierarchyAutocomplete
extends
EntityReferenceAutocompleteWidget
{
const
HIDE_WEIGHT
=
'hide_weight'
;
/**
* {@inheritdoc}
*/
public
function
errorElement
(
array
$element
,
ConstraintViolationInterface
$error
,
array
$form
,
FormStateInterface
$form_state
)
{
return
isset
(
$element
[
0
][
'target_id'
])
?
$element
[
0
][
'target_id'
]
:
FALSE
;
}
/**
* {@inheritdoc}
*/
...
...
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