New answers tagged

0 votes

How to update a views exposed filter programmatically?

In addition to checking the operator in the if statement "==" vs "=", the following should work. Note, the method overrides any existing filters hence the use of array_merge . $...
salah-1's user avatar
  • 214
1 vote

How to update a views exposed filter programmatically?

If you see above code there is syntax mistake use "==" operator: if ($exposedInput['a'] = 'apple') { Correct syntax: if ($exposedInput['a'] == 'apple') { if the dependent filter field 'b'...
Pooja Sharma's user avatar
0 votes

Modal does not handle errors on login

Here is snippet code to display the error message in popup: (Core: Login form) use Drupal\Core\Form\FormStateInterface; use Drupal\Core\EventSubscriber\MainContentViewSubscriber; use Drupal\Core\Ajax\...
Pooja Sharma's user avatar
0 votes

Remove a button from CKEditor based on the role of the current user

I had the same problem and was able to solve it with the hook_editor_js_settings_alter hook. In "editorSettings" > "toolbar" I removed the entry for the "Source" ...
Chris4783's user avatar
  • 968
0 votes

How do I theme a modal popup?

Have you tried this? On your custom module, add a file custom_module.module If you already have that file, edit it, and add this function custom_module_theme() { return array( 'twig-template-...
Pedro's user avatar
  • 124
-2 votes

How do I set the title tag for the maintenance page?

If you have access to the backend, you can modify the string directly for a temporary change. Change /var/www/html/ to the location of your install and other strings to fit your needs. Login with SSH....
Michael McMahon's user avatar
0 votes

Local drush stops working after changing files and folder permissions

Sometimes help just this: rm -rf vendor composer install
0 votes

Hide block on 404 (not found) page

programmatically: $route_name = \Drupal::request()->attributes->get('_route'); if ('system.404' === $route_name) { $region_name = 'content'; $block_names = ['oneBlockID', 'andAnother']...
Matoeil's user avatar
  • 3,319
2 votes

Query webform submissions

Remember to include accessCheck(FALSE) or you won't get any result. $query = \Drupal::entityQuery('webform_submission') ->condition('uid', $uid) ->accessCheck(FALSE); $result = $query-&...
Javi García's user avatar
0 votes

How can I reference previously imported media entities?

What I did that work: field_hero_image/target_id: - plugin: migration_lookup migration: previous_migrate_media_image source: node_uid - plugin: skip_on_empty method: row message: 'nid is ...
Pablo Fredes's user avatar
0 votes

How to update payment status inside an order?

It should be like below: $payments = \Drupal::entityTypeManager()->getStorage('commerce_payment')->loadByProperties(['order_id' => $order_idS]);
Kuntal Das's user avatar
0 votes

Exposed date filter that uses "Is between" doesn't include end date

This issue is also solved by the patch provided in
camilo.escobar's user avatar
0 votes

How do I access $this in a dataProvider method?

I hit this problem today as well, and it seems you are correct in your assumption from the comments that properties initialized within setUp() are not available in the data provider. According to the ...
Adrian Wiik's user avatar
0 votes

Install and enable 'Real AES' module: Dependency with Defuse PHP-encryption library

Founded solution: Download Ludwig - Install module and go to admin/reports/packages -
Mario's user avatar
  • 1
0 votes

How to add module libraries to the page through an admin page?

Replace: js: path/to/library/file1.js With js: path/to/library/file1.js: {}
Akash gupta's user avatar
0 votes

How do you programmatically include an entity type to a workflow?

This is now entityTypeManager rather than entityManager: // Add bundle to default workflow $workflow = \Drupal::entityTypeManager()->getStorage('workflow_type')->load('workflow_id'); $...
griz's user avatar
  • 194
0 votes

Override user login form template

In addition to Yuseferis answer: I'm using this function to add theme suggestions for forms in Drupal 10: /** * Implements hook_theme_suggestions_HOOK_alter() for form templates. * * Make forms ...
Ralf E.'s user avatar
  • 31

Top 50 recent answers are included