Correct way to populate file form field from ajax callback

I am working on a module to implement resumable.js as a way to do large file uploads in drupal 8. I have the uploading part working, but I'm struggling figuring out how to add the stored files to the file form element using ajax.

This is how I have planned it: After the upload finishes, the script will send data about the uploaded files to a hidden field in the form. An ajax callback will then be fired to update the file field. The ajax command will store the files in the drupal database using file_save_data, add the files to the form element and return the updated form element.

Remove breadcrumb in home (multilingual site)

Hello.

I'm locally testing my future Drupal 8 website and I'm running in some (minor) issues. Site is meant to be and configured in both English and Spanish. English is probably (because I'm not sure) the main language. Frontpage in English is ok but in the Spanish one a 'Home' link (to the very same Spanish frontpage) is shown in the area for breadcrumbs.

Do you know why is it there and not in the English version? And why is it linking to itself??? Anyway, how can I get rid of it, in a clean way if possible?

Thank you.
hip

Unable to access People Tab for creating User ACCOUNTS

Hello All,

I have installed drupal 8 on ubuntu 16.04 and all is working as required however the people section for creating user accounts is not accessible.
Whenever i click on that tab it shows blank page.All other sections are working.

Kindly let me know any possible reason.

Thanks.

Cannot override misc/autocomplete.js

I have a textfield that uses autocomplete. It basically works with the default misc/autocomplete.js. Now I want to override this with my own file. So I have in modules/custom/myModule/myModule.info.yml:

libraries-override:
  core/drupal.autocomplete:
    js:
      misc/autocomplete.js: js/autocomplete.js

with having my autocomplete.js in modules/custom/myModule/js. However, this is ignored. The page still uses core/misc/autocomplete.js. I tried several variants of the override entry, but nothing works. Any idea?

Change entity_reference field to dropdown

Hi,

I want to change my entity_reference field from autocomplete to dropdown list (select). So far I try another method by overriding in buildForm method in my form class but it produce the error (Error: Cannot unset string offsets in Drupal\Core\Field\WidgetBase->extractFormValues()). Here is my code.

Form lose data when saving node form

I'm writing a module that use Taxonomy terms for different data (cast, directors, ... of a movie). Now I prefill some default fields to a create node page using the hook_form_alter. The source to prefill the fields looks like:

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x