Using the Simplify module with another custom module that use hook form alter trigger a crash from Simplify
TypeError : class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given dans class_implements() (ligne 369 de *\modules\contrib\simplify\simplify.module).
Adding a null check for $entity
function simplify_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if (!method_exists($form_state->getFormObject(), 'getEntity')) {
return;
}
$entity = $form_state->getFormObject()->getEntity();
if(!is_null($entity)) {
if (in_array('Drupal\eck\EckEntityInterface', class_implements($entity))) {
// Get array of fields to hide.
$fields = _simplify_get_config_value('simplify_eck_global');
// Hide fields.
simplify_hide_fields($fields, $form);
}
}
}
Active
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.