Hot answers tagged

2

These scripts are added by the core module BigPipe. If you want to remove them from a specific page then add the option _no_big_pipe to the route: $route->setOption('_no_big_pipe', TRUE); See https://www.drupal.org/docs/drupal-apis/routing-system/altering-existing-routes-and-adding-new-routes-based-on-dynamic-ones


2

After you've created the custom block in UI you can place it in different regions. Each of these instances gets a machine name and hook_block_access() works as intended. If you want to control access on content entity level, this makes sense because you can use block content not only in block layout, implement an access hook for the entity type block_content:...


1

Is there any way to set this in a form_alter? Or should I just validate the checkbox state via JS? You could replace #required by setting a custom validation handler in the form alter hook, if you want to generate the error message server-side: $form_state->setErrorByName('field_tos_accept', $error_message); When I add '#required_error', this should - in ...


1

I just found a solution. I probably didn't explain it well, so there was no answer. I hope that the solution to the problem I had will better explain the situation I was in. function external_usa_list_webform_options_external_countries_alter(array &$options, array &$element) { // Load cached options. if ($cache = \Drupal::cache()->get('...


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