Commit 025c7d88 authored by Derek Adams's avatar Derek Adams
Browse files

fix for conditions on non entity forms

parent 0e04c870
Showing with 4 additions and 1 deletion
+4 -1
......@@ -5,7 +5,10 @@ use Drupal\node\Entity\NodeType;
function alloy_compose_form_alter(&$form, &$form_state, $form_id) {
if ($object = $form_state->getFormObject()) {
if ($entity = $object->getEntity()) {
if (!method_exists($object, 'getEntity')) {
return;
}
if ( $entity = $object->getEntity()) {
if ($entity->getEntityTypeId() == 'node') {
$node_type = NodeType::load($entity->bundle());
if ($node_type->getThirdPartySetting('alloy_compose', 'use_compose_interface', false)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment