All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
403 views

How to conditionally update and import nodes using Migrate?

I need to migrate new nodes and update others in the same time. 2 installations of the same project are out of sync, which means, that the same nid may not indicate the same node on both sides. But I'...
0
votes
0answers
23 views

entity ref shows on node, but not when node is set as home page

I suspect I may just have a simple misunderstanding of how a home page is generated, but... In a Drupal 8.7.5 website, I have a node (basic page) that I've added a paragraph entity reference field to....
4
votes
2answers
1k views

Load an AJAX submission enabled webform using another AJAX call

I am using Javascript/AJAX to call a path defined in a custom module which loads existing node content for display. i.e. you are at: /custom/path and it makes an AJAX request to /custom/content ...
1
vote
2answers
2k views

Uncaught TypeError: Cannot set property 'bootstrap' of undefined

I'm receiving the following two errors, i'm unsure how to fix them. after doing some research this file has had issues before. The solutions did not solve my problem. Could this be a simple script ...
0
votes
1answer
789 views

Using #states to disable a field collection field

I am trying to disable a date field's second value, inside a field collection, but it isn't working. My hook_form_alter has this: $form['field_certification']['und'][0]['field_validity']['und'][0][...
1
vote
1answer
348 views

How can I enable search on parts of a word and autocomplete suggestions?

I'm using Search API in Drupal 8. I tried with Search API pages and even views, but I didn't find %like% function query Can I do %like% in Search API or Views?
-2
votes
1answer
14 views

How to build drupal 8 eCommerce site

I would like to build my first eCommerce site which will sell products from different categories. Site also going to have affiliate links. I have searched online and see many useful information but I ...
1
vote
1answer
1k views

After DB backup and restore: Call to undefined function user_access() in …includes/menu.inc

This question pertains to a Drupal 7 multi-site install. As a test for some future backup/migrate bash scripting that I am doing for work, I made a backup/dump of my test site postgres DB. I then ...
0
votes
1answer
9 views

PHP fatal error when attempting to run drush

When attempting to run drush, it gives no output. It just fails. Looking at the error logs how this fatal error: PHP Fatal error: Default value for parameters with a class type hint can only be ...
0
votes
1answer
29 views

Extra Content Appears Below Footer

I have an issue where I have the page for a specific role showing up on every page and additionally an error message. These show up below the footer on the pages. I've gone through the theme files ...
2
votes
1answer
1k views

problem using ajax callback in form

I have a very simple form that has a select box of the terms in a vocabulary, and renders the selected term below it. It seems that the first time I change the value in the select it renders the ...
0
votes
0answers
9 views

Entity Reference View fails after update to drupal 8.7.6

Recently I updated my drupal site from 8.6.14 to 8.7.6. A previously-working Entity Reference View display that is connected to a form Autocomplete field stopped working. The spinning circle keeps ...
0
votes
0answers
8 views

Automatically Generate PDF from Webform Submission

First off, this is under Drupal 7. I'm looking to have the server save a PDF of the submitted webform when a user submits it or updates it (overwriting the old one on update). So far I've had no ...
0
votes
0answers
13 views

Why is wrong ajax callback function called?

I have two buttons $form['button_1'] = [ '#type' => 'button', '#value' => false, '#ajax' => [ 'callback' => '::ajax_submit_1', 'wrapper' => 'wrapper_1', ], '#...
1
vote
1answer
816 views

File field upload in modal/dialog

I have a custom content type with file field as one of the fields. For theming/UI purposes I should make this file field as clickable button. And only when user clicks on it, he/she gets modal window ...
6
votes
3answers
249 views
+100

View display plugin “entity reference” not using translation

For some of my entity reference fields I'm using "Views: Filter by an entity reference views" as reference method. I've configured those views to use the current interface language for rendering (with ...
0
votes
0answers
18 views

How does will() actually test anything?

I'm beginning to learn about writing tests for Drupal 8 via PHPUnit and am unclear on how the will() method actually serves to test anything. Given this code (derived from examples and tutorials on ...
2
votes
1answer
356 views

How do I add onclick Google Analtyics custom event “add to cart” to add to cart button in Drupal Commerce?

I want to fire a Google Analytics custom event called "add to cart" when someone adds a product to the cart. I am using classic Google Analytics, not Universal. I tried adding this to the ...
1
vote
1answer
17 views

Patch method sample code REST API

I am working on web services in drupal. I have created a sample module for get method to expose the data using web services. I have not found any sample code for the patch method. code for get method: ...
0
votes
0answers
8 views

How do I get the upload progress bar activated for image uploads?

I am on the latest version of D8, on a LEMP stack, and have PECL upload progress enabled. I’m also using cloudlare cdn modules for caching and similar, but not yet for any file storage. Looks like I’...
0
votes
0answers
12 views

Serialization of dependencies

I'm using Drupal 8.6 and I'm doing the serialization of a node. This node has related fields, which I also would like to serialize. In my case I have an article which has a photo gallery which has ...
-3
votes
1answer
21 views

How do I deploy a site?

I am following this link to set-up a Drupal 8 site, I am installing drupal-composer/drupal-project as a template for my composer install for the first time, as I forced myself into drupal 8 for future ...
0
votes
2answers
4k views

Display success message after submitting form

I am try to display an success message after submitting my form and redirect to next page. The code I am using is the following. public function submitForm(array &$form, FormStateInterface $...
2
votes
1answer
522 views

Can I have both Language and Country path prefixes?

On our site, paths are all prefixed by language and country. For example: http://example.com/en/us/about In Drupal 7, a previous vendor implemented this by using the Persistent URL module, which ...
0
votes
0answers
7 views

viewElements Fails To Fire in Custom Field Formatter

Using the code, below, in my_module in the path my_module/src/Plugin/Field/FieldFormatter/DateRangeSpecialFormatter.php the format appears both in the Views field dialog and the content type manage ...
-2
votes
0answers
16 views

docker on virtual box running out of memory [on hold]

I'm running docker on an oracle vm and running a drupal instance , where i do migrations from a d7 to d8 database both of which are there . the migrations were running fine but lately i get a memory ...
0
votes
0answers
13 views

How to disable form button on ajax callback?

I have a button with ajax callback and I want to disable it on button click without page reload. Preferably inside ajax_function but it's not obligatory. $form['my_button'] = [ '#type' => '...
2
votes
1answer
781 views

How to show list & thumbnail widget in plupload?

I have installed the following modules: FileField Sources Plupload, FileField Sources, Plupload module and added latest plupload library. While uploading multiple files it is showing only list of ...
1
vote
0answers
8 views

Why doesn't Rules Conditional recognize a hidden field value?

I'm using Drupal 7. I have a simple "email confirmation" system set up using rules. The setup is this: "Reservation" Content Type has a boolean check box for "confirmed". "Reservation" Content Type ...
-4
votes
0answers
29 views

Switch language without URL being switched

I want to switch language in my Drupal 8. My language detection is URL. But I don't want users to be able to override the language switch by typing in the address bar. For example www.mysite.com/ (...
-2
votes
0answers
14 views

How do I enable users to submit sessions in “Conference Organizing Distribution”?

I don't see any configuration item or link that would enable logged-in users to submit sessions in the Conference Organizing Distribution module. How can I enable this? What link should I use? I'm ...
1
vote
1answer
36 views

Cache pages/variables in hook_preprocess() for anonymous user

So I am having trouble understanding the caching of variables set in hook_preproccesses for anonymous users. It seems that the entire page is cached, and not rebuilt, even when set to no caching. With ...
4
votes
2answers
632 views

How can I block users from registering with disposable email addresses?

I have a site where users send messages to one another using the Private Message module, and they are notified of messages by email. On this site, there are a variety of spammers, scammers, and ...
0
votes
1answer
14 views

How to show a field value instead of the node title for nodes displayed through an entity reference field?

Edit: I think I found the place, just not the method yet. If correct, I will close this question. Sorry. I have no clue which hook or direction to look into. I would like to have a label or title ...
2
votes
1answer
639 views

Data in field_revision with Create new revision unchecked

The field_data_myfield and field_revision_myfield have the same row entries (D7 fields). All of my content types have the "Create new revision" unchecked. Is this how it's suppose to work? If yes, two ...
0
votes
2answers
34 views

Webform Error Occurs During Configuration Import

Currently we are having some trouble handling webform module configuration on our various environments. When running a configuration import drupal config:import --directory=$SYNC_DIR on our dev ...
0
votes
0answers
21 views

How to register a custom function for labelCallbacks for an existing entity?

I learned that in EntityBase the label method gets called to determine the label for an entity, for instance when it is rendered via the entity reference module as label. Now, for specific node types ...
0
votes
3answers
1k views

Checkbox in views

How to bring the input type as check box for a field . I ve used Global:Custom Text and in that field I gave like this in text <div class="cmp-button"><input type="checkbox" name="product-...
-1
votes
1answer
7 views

How can I import a local database remotely without having a local database copy?

I am working on database security and with using Drupal we have daily backups from a cloud server which we access remotely. What I normally do is grab a daily DB copy from the cloud server, move the ...
-1
votes
0answers
5 views

How to make the overviewTable to be descending

I want to have an overview table with descending id's. It feels like i looked everywhere for the answer but it just feels like nobody cares.
0
votes
2answers
869 views

“The website encountered an unexpected error. Please try again later.” error show on cache clear

My Drupal 8 site is working fine but when I am clearing the cache then my site display below errors. The website encountered an unexpected error. Please try again later. Please suggest me ...
0
votes
0answers
8 views

Migrating into Double field

I am migrating a CSV into D8 node type which has a double field. The CSV has the following structure: I am trying to migrate the year, from the header, into the first double-field subfield (as a ...
0
votes
1answer
348 views

Webform 'Save draft' to send a mail with $sid

I am having a webform and I display the 'Save Draft' buttoan on the form. Once I click on the Save draft I need to save all the values in the DB (as it does on Submit event) and should send an e-mail ...
62
votes
9answers
119k views

How do I access a field value for an entity (e.g. node) object?

node_load((int) $nid) loads a fully-populated node entity. $node->title->value gets the title, but how do I access field values in Drupal 8?
1
vote
1answer
31 views

Is there a way to update custom packages with composer?

The project is using Drupal 8 composer template to manage dependencies. Some of the packages are defined locally to look like Drupal modules and be installed in a specific location. An example could ...
0
votes
0answers
11 views

Media field permissions

I have a certain use case. I have an entity that has a "media" reference field. I want users to be able to add/edit/delete media entities without giving them Edit any media or Delete any media ...
2
votes
3answers
2k views

How to get translated month labels

I think, this labels and its translations are available, but I don't know where. I found nothing in the "Translate Interface" seach. So here's my question: is there a way to get translated month ...
1
vote
1answer
41 views

Why ajax button calls submitForm?

I have no problems with using Ajax in every form element other then button. When I'm clicking this button '#type' => 'submit', '#ajax' => [ 'callback' => '::ajax_function', '...
0
votes
1answer
14 views

Specify the URL

I'm creating an API service using Services (Drupal 7) and would like to create an URL like /api/avu/v1/{id}. I have api in Path to endpoint and in hook_services_resources() I have $resources['avu'] ...
9
votes
3answers
1k views

LIKE clause not working in hook query alter

I'm trying to replace the default search with a LIKE clause in Drupal 7. I tried to alter the query according to Adding an OR condition to an existing query: function MYMODULE_query_node_access_alter(...

15 30 50 per page