All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
30 views

Error “An illegal choice has been detected. Please contact the site administrator.” [duplicate]

I get the error shown below while trying to implement dependent dropdown for country state as shown below while trying to submit form which implements AJAX in drupal 8 for country - state dropdown I ...
0
votes
0answers
18 views

2nd Opinion regarding data encryption

I'm managing a smaller project that uses Drupal 8. The site allows for users to register for an account. There is a simple feature which sends the user a welcome email along with their 'login ...
0
votes
1answer
24 views

Multiple pagers on same view page

When creating a view whose display type is page, we got an option to apply pagination using pager option given in view, where you get sort of radio buttons to select pager, full, mini, etc.. Do we ...
-1
votes
0answers
14 views

ajax with hook_form

how to use ajax callback on hook_form_alter ? i can modify title and value the field on /node/add first i create info.yml then module.. the module contain this.. <?php function ...
0
votes
1answer
21 views

Drush custom command not found in context of running --root option

Drush 8. Have the custom module with the custom command. Call drush custom-command works as expected. Call drush --root=sites/subsite custom-command thiggers the error: The drush command 'custom-...
0
votes
0answers
13 views

Field Collection has Entity Reference field that use an Entity Reference View based on current NID. Adding an FC item clears all values

My node type has an unlimited values field collection. It has an entity reference field for Users. Its available values come from a view that uses current NID. The first FC item works fine, but when ...
0
votes
0answers
25 views

How to debug why some content is not migrated from D7 to D8?

I am using migrate_plus to migrate from D7 to D8 and so far it has been a fairly smooth process. I have a particular content type that has 10 nodes in D7 but will only migrate one of them to D8. ...
0
votes
0answers
21 views

Export blocks added via layout builder as default content

I am using Layout Builder to add blocks into my nodes. I am adding several instances of different custom block types to specific content individually. I wander if it is it possible to export those ...
0
votes
1answer
59 views

After update the drupal to 8.5.15, I am getting this error -You have requested a non-existent service “entity.memory_cache” [on hold]

I am getting this error in browser. The website encountered an unexpected error. Please try again later. When i checked the error log, then i got this in error log- Uncaught PHP Exception ...
0
votes
1answer
64 views

Error when running custom migration

I am new to writing migrations. I am attempting to figure it out with what I thought was simple case of migrating a title into a content type from a single XML file. The file has been uploaded to /...
0
votes
0answers
19 views

How to format Rest API response

I am using drupal 8 REST API and I tested /user/login?_format=json for login. { "current_user": { "uid": "593", "name": "askeraa@asample.aa" }, "csrf_token": "...
-1
votes
1answer
20 views

Relationship duplicates data

I have a view of content type documents wherein I want the logged in user to request access for each document and after it approved or rejected the status next to that list of documents should show ...
-3
votes
0answers
10 views

Is there a usable type definitions for drupal core entities + jsonapi?

Is there a usable type definitions for drupal core entities + jsonapi? Writing frontend app using nuxtjs/typescript/jsonapi... any expirience/recommendations/etc will be very interesting.
0
votes
0answers
10 views

How to filter only one of many content types based on creation date

I'm using search_api_db to index many content types regardless of creation date. My view has a single filter: Search: Fulltext search (exposed). It all works nicely. Now I want to add a creation date ...
0
votes
0answers
6 views

Update user avatar from another field image in profile2

Here is what I need to achieve: There is a image field in my user's profile (Profile2 module) When users update that image in their profiles, the user avatar must be updated too with the same image. ...
1
vote
1answer
20 views

Hide a field for that particular row based on value from custom table

I have a custom module where in a user requests access to view a node. I have a view page which currently lists all nodes and has a button "Request Access" to it. When the user clicks on it, an entry ...
0
votes
0answers
11 views

How generate a token for consumer with simple_oauth?

I'm searching how to generate a token with simple_oauth but I'm lost due the installation of our drupal. We're using the Headless Lightning distribution with JSON:API, consumers and simple oauth for a ...
0
votes
0answers
15 views

Exclude “route:<nolink>” or “root” from pattern

Using Pathauto patterns, the closest I can get to my desired output is /[node:menu-link:parents:join-path]/[node:title]. However, I am wondering if there is an approach to configure a pattern where a ...
0
votes
0answers
18 views

View Custom Table not showing up in views list

I am using "View Custom Table" module, and am trying to render a table from the drupal database. According to the documentation, after the Custom table is defined, it should be available as a dropdown ...
-1
votes
1answer
26 views

Patch Status for 'cweagans/composer-patches'?

It seems that 'Drush Patch File' (https://bitbucket.org/davereid/drush-patchfile/src/master/) isn't compatible with Drush 9. It, however, has one important function - Patch Status - which enables ...
0
votes
0answers
22 views

How to migrate from directory of xml files on same server

I am completely new to using Migration. I need to migrate data from files that are contained in folders inside a directory that has already been transferred to the destination site. How do I set up ...
0
votes
0answers
9 views

How to debug callback function in hook_menu()

I am building a small payment method for Drupal Commerce. When calling the external payment service (Swish) I get a http response saying that the request was successful. After this request and ...
0
votes
1answer
16 views

Show all nodes with the same term, the current user is assigned to

That sounds quite simple but I can't find a hint how to do this: I have invoices with a term reference to a "Department" vocabulary [field_invoice_department]. The user has a term reference to the ...
0
votes
0answers
32 views

JSON view (rest export)

I have a rest export view and this is my output: { title: "about", view: "[{"id":7,"field_history_json":7,"field_history_text":"sdfsfsdffd","field_history_year":3244}]" } My field "view" is a ...
0
votes
0answers
29 views

Primary-replica using PostgreSQL

I have master-standby servers on PostgreSQL working perfectly. I followed Database Configuration and edited the settings.php file to contain the following code. $databases['default']['default'] = ...
-3
votes
0answers
29 views

Invalid Argument Exception - Class does not exist

I am facing issue while accessing the config form InvalidArgumentException: Class "\Drupal\popup\Form\ModalConfig" does not exist in Drupal\Core\DependencyInjection\ClassResolver->...
0
votes
0answers
12 views

Feed importers: How to import JSON data into a node's field while keeping it formatted as JSON

I'm using Feeds, Feeds Extensible Parsers and the jsonPath Parser to import several thousand items into a D7 site. Each item creates a corresponding Node. The values of most of the JSON key:value ...
0
votes
1answer
34 views

Additional file entity fields in widget_form

I've added additional fields to my file entity types and would like to have them in upload widget, just like file description. How can I add my custom fields element using field_widget_form_alter? (...
0
votes
0answers
42 views

How to create a Contextual Filter using an Entity Reference field in user's profile?

My site's users have an entity reference field in their profile called "Club" where they select which Club they are a member of. Similarly, when creating a Project (a content type) you can select ...
-2
votes
1answer
43 views

What exactly does this part of code do? [closed]

There is a code snippet in a .twig file that I can't understand. Here is the code: {% set show_emer_alert = 'ALL CLEAR' in page.emergency|render ? 'N' : 'Y' %} {% if show_emer_alert == 'Y' %} {...
1
vote
1answer
48 views

Get block id in block theme template

I'd like to be able to print the block id/number of my custom block in its template. I feel like these must exist because Display Suite has a token for it: [block_content:id]. Like a url to edit a ...
0
votes
1answer
19 views

Use Display Suite token field in custom block type template

I have a custom block type, which uses its own theme template. I have a display suite token field link_card_edit_block It just uses HTML and tokens to create a link. I want to use that field in my ...
0
votes
0answers
15 views

How to attached a JS file to a Webform Custom Handler

I've written a custom Webform Handler which when the user clicks Submit, sends the data from the Webform to an external api. The handler is working perfectly but it takes a few seconds for the ...
2
votes
1answer
30 views

Find which views are using Views PHP

I have a project that is using Views PHP, and I'd like to figure out which views are using PHP from this module. This will help me determine if I can easily remove the dependency on the module. Is ...
-2
votes
0answers
32 views

Trying to prevent Contact Form module from saving submissions to the database

I am trying to somehow prevent contact forms from saving to the db when submitted since contact forms is a core module. Any suggestions on possible hooks or some way to follow through with the submit ...
0
votes
0answers
26 views

Uncaught PHP Exception: Query tagged for node access but there is no node table, specify the base_table using meta data

Can anyone give me a hint where this error could come from? When a user tries to access a specific node in the login-area of my Drupal 8 website, he randomly gets a white screen with the message "The ...
-3
votes
1answer
30 views

I want to set some error message at one method and display it at another method [closed]

I have a method , here I set some message . function doSomeAction(){ $messenger = \Drupal::Messenger(); $messenger->addMessage('error msg',$messenger::TYPE_ERROR,true); $response = new ...
0
votes
1answer
29 views

Webform submission ID

I have added a submit handler function in my .module file so i can execute some custom code when a form(webform) is submitted:- function mh_newsletter_form_alter(&$form, $form_state, $form_id) { ...
-3
votes
0answers
23 views

Return to the product page

Is there a way when a customer purchased a product but want to return the product to edit that in the excisting order? There is not a functional RMA module for Commerce2 so far.
0
votes
0answers
23 views

isset(($_GET['variable'] ) not TRUE anymore after AJAX submit?

I have a variable e.g. for a search query which i save in the URL: .../page?variable=value I get this variable and save it as a global variable so i can use it in all functions of my file: if (...
0
votes
0answers
4 views

Simpletest with multiple users to simulate database race condition

There is a race condition in my Drupal module, that can be reproduced like this: User A loads a form User B loads a form User B submits their form User A submits their form Things go wrong at step 4....
0
votes
0answers
26 views

Automatically created Forum vocabulary

When I enable core forum module it does not automatically create "Forums" vocabulary in taxonomy and it uses another vocabulary instead. I've tried to create Forums vocabulary manually and then ...
0
votes
1answer
34 views

Modification of HTML mail template

I am using HTML Mail module. I have created an html email template specific to my form(webform) in the template folder of my theme directory. My form name is newsletter and the template name is ...
-1
votes
0answers
22 views

How to create a view that displays results based on certain conditions?

I need to create a view based on user of a certain role. Now, I need to display results of this view depending on some conditions: If the user is not a subscriber, the view should only show their ...
0
votes
0answers
34 views

Is it possible to output all taxonomy terms in page--products.html.twig template?

I am using Drupal 8.7.5. I setup three different taxonomy types. They are Category, Types, and Tags. I have a custom post type called Products. I created a View called Products and added that as a ...
-1
votes
1answer
42 views

How do I pull data from an external database, and display it in Views? [closed]

I am fairly new to Drupal, and just started working with Drupal 8. I know a table can be generated in Views for the content which is displayed/used somewhere on the site, and a table can also be ...
0
votes
1answer
46 views

Can I get the relationships of a node using node_load()?

I want to load relationships from the node_load(). So for example getting the article content type and loading the author information with the same query. How would I go about doing this? The end ...
2
votes
1answer
40 views

How do I hide “View most recent blog entries”

If you enable the contributed Blog module, a link with the anchor text "View most recent blog entries" shows up on every post. I want to hide this link using PHP (i.e. not resorting to css or ...
1
vote
0answers
22 views

Create CiviCRM Contact when creating Node “Content”

I have created a Content Type in Drupal called "Companies", when i save a new company i want a CiviCRM Contact created as a Organisation Contact Type. Is this possible using the Rules or CiviCRM ...
0
votes
0answers
31 views

Adding Local Tasks gives Page Not Found 404 error to all tabs excluding default tab using local tasks?

Under custom_changes.links.task.yml custom_changes.menu_example.tasks: route_name: custom_changes.menu_example.tabs title: Default primary tab base_route: custom_changes.menu_example.tabs ...

15 30 50 per page