erwindaez β created an issue.
Hi @dieterholvoet
Steps on how to reproduce the issue
1. Add constraint on your custom form field, example
$form['my_custom_field'] = [
'#type' => 'managed_file',
'#upload_validators' => [
'CustomFormat' => ['format' => $format],
],
];
2. Create CustomFormatConstraint and CustomFormatConstraintValidator classes
3. Add validate to CustomFormatConstraintValidator
4. Test if the message from your constraint will show up
Currently what is happening if we have invalid value to the field
https://www.drupal.org/files/issues/2024-09-26/Screenshot%202024-09-26%2... β
Hi @dieterholvoet
For this one I think the issue is on toastify\Element\ToastifyStatusMessages, renderMessages interrupts all messages event the messages that Contstraint validator shows
public static function renderMessages($type = NULL): array {
if (!\Drupal::currentUser()->hasPermission('show toastify messages')) {
return parent::renderMessages($type);
}
$render = [];
if (isset($type)) {
$messages = [
$type => \Drupal::messenger()->deleteByType($type),
];
}
else {
$messages = \Drupal::messenger()->deleteAll();
}
if ($messages) {
// Pass the messages to Toastify.
$render['#attached']['drupalSettings']['toastify']['messages'] = $messages;
}
return $render;
}
A sample screenshot is the current behavior on what toastify does
https://www.drupal.org/files/issues/2024-09-26/Screenshot%202024-09-26%2... β
VS on what we expect
https://www.drupal.org/files/issues/2024-09-26/Screenshot%202024-09-26%2... β
erwindaez β created an issue.
erwindaez β created an issue.
erwindaez β created an issue.
erwindaez β created an issue.
erwindaez β changed the visibility of the branch 3464585-update-cta-image to active.
erwindaez β changed the visibility of the branch 3464585-CTA-image-field to hidden.
erwindaez β made their first commit to this issueβs fork.
erwindaez β made their first commit to this issueβs fork.
erwindaez β created an issue.
erwindaez β created an issue.
erwindaez β created an issue.
erwindaez β made their first commit to this issueβs fork.
Added the patch to resolve the issue
erwindaez β created an issue.
Hi Keshav,
Confirmed the patch on #5 complies with #4
Here is the code on line 22:
/**
* {@inheritdoc}
*/
public function getFile() {
return base_path() . 'libraries/eqneditor/plugin.js';
}
Hi @alok_singh,
Confirmed updated, please see the screenshot
erwindaez β made their first commit to this issueβs fork.