Skip to content
Snippets Groups Projects
Commit ec1c4089 authored by James Wilson's avatar James Wilson
Browse files

Issue #3270876 by sonfd, hmendes, jwilson3: Check if $form_object->getEntity() is public

parent ca0a6f69
No related branches found
Tags 2.0.0-beta4
1 merge request!6Issue #3358092: Fix the issues reported by phpcs
......@@ -47,6 +47,11 @@ function label_help_form_alter(&$form, &$form_state, $form_id) {
if (!method_exists($form_object, 'getEntity')) {
return;
}
$method = new ReflectionMethod($form_object, 'getEntity');
if (!$method->isPublic()) {
return;
}
$form_entity = $form_object->getEntity();
if (!method_exists($form_entity, 'getFieldDefinition')) {
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment