Problem/Motivation
Error location:
modules/contrib/simplelogin/simplelogin.module:228
The website encountered an unexpected error. Try again later. Error: Cannot use object of type Drupal\Core\Render\Markup as array in simplelogin_form_alter() (line 228 of modules/contrib/simplelogin/simplelogin.module). Drupal\Core\Extension\ModuleHandler->alter() (Line: 892) Drupal\Core\Form\FormBuilder->prepareForm() (Line: 249) Drupal\autosave_form\Form\AutosaveFormBuilder->prepareForm() (Line: 304) Drupal\Core\Form\FormBuilder->buildForm() (Line: 97) Drupal\autosave_form\Form\AutosaveFormBuilder->buildForm() (Line: 73)
Steps to reproduce
Enable the latest version: 7.1.3
Proposed resolution
Line no: 228
if (is_array($value) && isset($value['#type']) && in_array($value['#type'], $types)) {
$title = $value['#title'] ?? '';
// Convert Markup object to string safely
if ($title instanceof \Drupal\Core\Render\Markup) {
$title = $title->__toString();
}
$form[$key]['#attributes']["placeholder"] = $title;
$form[$key]['#title_display'] = 'invisible';
$form[$key]['#description'] = '';
}| Comment | File | Size | Author |
|---|---|---|---|
| #3 | simplelogin-drupal11-compatability-3573421-3.patch | 1003 bytes | thirstysix |
Comments
Comment #2
thirstysix commentedPatch file for D11, CMS
Comment #3
thirstysix commentedUpdated #3 patch file