Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

1

The IEF Api has a hook for performing alterations before the entity form is included on the IEF widget. You can add your message after checking you're on the right form/entity. /** * Perform alterations before an entity form is included in the IEF widget. * * @param $entity_form * Nested array of form elements that comprise the entity form. * @param $...


1

You can do this using JS. Add a click event listener on the Add item button. When the button is clicked you set a message. Something like this should work: $('.add-item-class').on('click', function () { const messages = new Drupal.Message(); messages.add('You clicked the add item button!'); }); Make sure you have Drupal available in your JS file by ...


1

I have now found that if you use a different approach to pagination the ajax issue is no longer present. I removed the pagination extender in the database query and have initialised the pager manually. This code now works: public function buildForm(array $form, FormStateInterface $form_state) { /** @var \Symfony\Component\HttpFoundation\Session\Session $...


1

For some weird reason the Ajax response wasn't updating the form_build_id value and the request takes it as the same form, so I added a new Ajax Command: function saveAjaxForm(&$form, FormStateInterface $form_state) { $old_form_build_id = $form['#build_id']; $new_form_build_id = $old_form_build_id.rand(); $response = new AjaxResponse(); $...


1

Actually, @Kevin was almost right. There was the search form that does not use AJAX but somehow Drupal gave the same id to both submit buttons (it was edit-submit--2. Is it a Drupal core bug?). So I had to gave custom id to my submit button and now it works fine.


1

This patch is related to this issue https://www.drupal.org/files/issues/2019-08-01/2842525-56.patch. See the section core/modules/views/src/ViewExecutable.php especially, the FormBuilder part is already committed but the rest is waiting.


Only top voted, non community-wiki answers of a minimum length are eligible