New answers tagged

0

Solved. The problem was that I had a template file for html.html.twig, where the main content was being wrapped in two divs. The problem was that the code <js-bottom-placeholder token="{{ placeholder_token|raw }}"> was being wrapped too making the AJAX fail, although I don't know why only for users that were not administrators. Moving this piece ...


1

The core example is in FileWidgetAjaxController::progress. You need to return a JSON-encoded associative array with message and percentage keys. For example: $progress['message'] = t('Uploading... (@current of @total)', ['@current' => format_size($status['bytes_uploaded']), '@total' => format_size($status['bytes_total'])]); $progress['percentage'] = ...


0

ajax_example_autocheckboxes_callback function is not defined in the above code. Also please update more info about what you are trying to do. $form[$term->tid] = array(... 'ajax_example_autocheckboxes_callback' ...); //ajax callback $form['tree']; //new field. after the above function call you can get new built_info of $form_state as its rebuilt. So ...


0

Our live environment had no PHP Opcache after we switched over to PHP7. Implementing that sped things up for us quite a bit.


0

To get this working I had to create a hidden field to store the value and use a custom selectHandler applied via class. JavaScript File (function ($, Drupal) { 'use strict'; /** * Override drupal selectHandler function */ function customSelectHandler(event, ui) { var valueField = $(event.target); if($(event.target).hasClass('MYCUSTOM-...


0

The solution above is for Drupal 7. In Drupal 8, hook_views_ajax_data_alter is deprecated and was replaced by hook_ajax_render_alter. For those of you looking for it, here is how to do it in Drupal 8 (source here). function YOURMODULE_ajax_render_alter(array &$data) { foreach ($data as $key => $command) { if ($command['command'] === '...


Top 50 recent answers are included