


Migrate address field
I am currently searching for a example to migrate data into an address field in Drupal 8 without any luck for now. Has someone a hint for me on how to map the fields? I tried the following: my.migrate.yml file: ‘field_date_address/address_line1’:... read more
Update multiple rows (with different ids and different values) using one query
I want to update multiple rows in a custom table using just one query. Each row has its own id (obviously) and different fields/values to update. Given this question and this post, i think i can achieve it with a single db_query, similar to this one: UPDATE {table}... read more
Language-dependent logo
How can I use a custom logo image in Drupal 8 that is language dependent? There does not seem to be an appropriate setting in the Content and Language Translation configuration page. read more
Views Data Export Permissions Problem
I have Views Data Export installed, which creates a CSV file attached to every node. This file has all of the data from a field collection field arranged as a CSV. The only user that should be able to download this CSV file is the admin (user 1) and the user that... read more
Editing a Field Collection element in a custom module
In a custom module, I’d like to to edit a Field Collection element. The element is linked to a taxonomy but I think the code would look quite similar if it was to a content type. I’ve read a lot of documentation, source code, forum entries and Drupal... read more
setting default language in drupal multilingual module
In my website, I have 2 language English and Marathi. 1st default language is English and I have added some content too. but now my requirement is to set default language as Marathi. I have gone to admin/config/regional/language setting and done default language as... read more
Prevent dual submit on form submission
I’ve got a form that submits via AJAX and in the callback I need to rebuild certain parts of the page to reflect the newly submitted data. One of these parts is the form, which I need to clear all user input values from so it’s ready to use again.... read more
How do I filter the current year?
Initially, I have installed the Token module and created a Views block containing years. I want to filter out the current year from the block (it should not show the current year). In filter criteria, I have changed content:year ([current-date:custom:Y]), but it is... read more
Add file field with Form API
I’m writing a block plugin that uses the form API to allow users to edit its settings, and then output them into a template. I’m currently using <?php /** * @file * Contains Drupalmy_pluginsPluginBlockInfoWithSideImage. */ namespace... read more
When I upload an image in drupal 8 the imagestyles are not shown for the first time
My settings are, allow_insecure_derivatives: true suppress_itok_output: false Editing the itok token for the image src works at the browser level. Does anyone know what causes the issue and a fix for it? Notes : When I hit CTRL+SHIFT+R in the browser the imagestyle... read more
Programmatically querying via SearchApiAcquiaSearchService
I am working on a site where querying using SearchApiSolrService is successful. However, when I deploy to Acquia Cloud and attempt to access the Acquia Search using the SearchApiAcquiaSearchService I get a 403 Forbidden. Response SearchApiException: “403”... read more
What is the #target_type value used by the EntityAutocomplete class?
What is the #target_type value accepted by EntityAutocomplete? The documentation for EntityAutocomplete::processEntityAutocomplete() says it’s the ID of the target entity type. How can I get a list of possible IDs I could use? read more
How can we achieve multiple forms in a single page?
I have menu callback which is getting called multiple times on the same page by an AJAX request resulting rendering the form with same HTML id $items[‘mymodule/page’] = array( ‘page callback’ => ‘drupal_get_form’, ‘page... read more
Captcha session reuse attack detected error message in form with anonymous user
I am experiencing a problem with the Captcha module 7.x-1.3 version (under Drupal 7.39) I don’t use webforms My form is a simple Contact form My form does not contain any AJAX field My form does not contain any file or image upload system I configured the... read more
How can I programmatically render a node’s field respecting the view mode settings?
I want to render a node’s field inside a block. It works like this: <?php if ($node) { if (isset($node->field_body_secondary) && $field = $node->field_body_secondary->value) { $markup = render($field); $build = array( ‘#type’... read more
How to check in a rule if the data from a field collection has changed?
I want to add a rule (using the Rules module) for printing a message after changing a field in a field collection. The field collection consists of the following three fields: Reference to Version (type: Entity reference) Related Entities (type: Term reference)... read more
Change the bulk operations confirmation page
How to change confirmation page in bulk operations? Currently it is printing “You selected the following 4 items:”. I want to list titles of all items included in the bulk operation. read more
Search indexing slow query
Drupal 7.x The search module’s indexing maintenance sql query takes a couple of minutes to complete each time cron gets triggered. SELECT t.word AS realword, i.word FROM search_total t LEFT JOIN search_index i ON t.word = i.word WHERE i.word IS NULL` Database... read more