All Questions

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

Filter Views With Tokens on Computed Token Fields

I want to add a filter criteria on my view with a token (ex: [webform_submission: user: name]) on a "Computed Token Field" of my webform. To display the data of my Webform in my view I use ...
0
votes
0answers
6 views

Using rules to Flag a Product Display Node on Checkout

Every user is supposed to purchase Particular product only once. So i have a view to list the Product Display which by using FLAG module i can list only Unflagged Product Display nodes (Products ...
0
votes
0answers
12 views

Menu link Converting full URL to local

When I save a menu link pointing to a node (nid 5, alias /woohoo/magic/test, it's value in the database is: entity:node/5 I'm trying to convert fully formed user inputs such as "http://127.0.0.1:...
-1
votes
0answers
17 views

Redirect non-www to www in settings.php for Drupal 8 [closed]

I want to redirect all non-www to www in below function. if ( (!array_key_exists('HTTPS', $_SERVER)) && (PHP_SAPI !== 'cli') ) { if (substr($_SERVER['HTTP_HOST'], 0, 4) <> 'www.') { ...
0
votes
0answers
8 views

Token replacement in webform custom element (webform_score module)

I use the module webform_score for my project but the webform element RadiosQuiz doesn't handle the tokens replacement. I'd like to use tokens in title and options text. I look on the RadioQuiz.php ...
0
votes
0answers
13 views

Webform Custom element option values validate

Can anyone please suggest how to validate the custom element option values ( select). This validate should work, once we add new element to the form and fill the option value and then click save / ...
0
votes
0answers
6 views

Is there any way to set a flag field value on flag creation?

I have a Flag with a boolean field, Happy. I want to set the value of this field when I flag content programmatically. My question Is there a way to set the value of the flag field when creating the ...
0
votes
0answers
13 views

Replace Block on click of form element

I have a block which contains a form (I used the build() method) . One of the form elements has a suffix as follows: $form['test'] = array( '#type' => 'number', '#placeholder' => t(...
0
votes
0answers
23 views

How do I connect Netbeans IDE to AWS Bitnami installation?

I'm hosting a Drupal 8 installation on AWS using the recommended Bitnami image. I'd like to be able to edit some of the files remotely from my computer using the NetBeans IDE. I've successfully ...
0
votes
0answers
7 views

Autofocus on select or textfield works on and off

I have set autofocus on my form element as follows: $form['product']['widget']['#attributes']['autofocus'] = TRUE; The element is autofocused intermittently, if I refresh page 10 times it works for ...
-3
votes
0answers
17 views

What is the alternative phone_countries() ,and valid_phone_number() [closed]

in my custom d7 code i was used this line of code $form['extra']['multicountry'] = array( '#type' => 'checkboxes', '#options' => phone_countries(), foreach ($country_keys as $...
0
votes
1answer
13 views

user deletion : user_cancel_reassign not working when user has more than 10 associated contents

I am attempting to suppress Users with no permissions/roles from our sites. The user associated contents should be kept on user deletion. This code below works when the user has a few associated ...
0
votes
0answers
19 views

Get the first letter of each word in a string in twig [closed]

is there simple we can get Get the first letter of each word in a string I google it and found an answer for PHP not for twig. PHP answer link that what I want in twig Click here {% set string = "...
0
votes
0answers
10 views

Exract all node field values to json including reference entities with value

I am writing a module to export drupal's content to another platform, the module provides a UI to manage content types and their fields to be shared on another platform via API. So far i have managed ...
0
votes
0answers
9 views

How to decode base64 image using pre save hook?

I am uploading image using jsonapi. But here the data is base64 format (As per requirement). Uploading to media entity. So I need to write a hook media entity pre save so that file uploaded should be ...
1
vote
1answer
21 views

Symfony\Component\HttpFoundation\Response is never cached

My custom controller is returning data but it is never being cached. My controller function: use Symfony\Component\HttpFoundation\Response; $build = [ '#theme' => 'search_form_suggest'...
0
votes
1answer
12 views

Delete Query Syntax

I am trying to write queries in drupal 8 , I know that I must use the delete() function , however just for testing on my draft I tried the following query and it worked : $connection = \Drupal::...
0
votes
1answer
17 views

How to alter an existing breadcrumb link programmatically?

I am trying to alter the 'Home' Breadcrumb link using hook_system_breadcrumb_alter() The default Breadcrumb class allows you to add New links using the addLinks method. However it does not allow one ...
-2
votes
0answers
12 views

Autofill drupal field in edit page

I am not sure if this was posted earlier, but I would be specific and conscise. I am writing a Drupal module to store post meta in the "Node edit" page field. Just basic field, in node edit ...
0
votes
0answers
11 views

How to aggregate values from fields in Paragraphs based on value of another field in that same paragraph, and display in an aggregated Views table?

Hopefully my title makes sense... I am setting up a Drupal 9 website for internal use as a financial reporting engine and a CRM. I am making use of the following modules: Paragraphs Views Viewfield ...
-1
votes
0answers
13 views

Site does not update on mobile devices

I have a site built in Drupal 7. It is using leaflet to plot GPS advancements in real time. On laptops and desktops I have to refresh the browser (any browser on Mac/Linux/Windows) to see the updates. ...
0
votes
0answers
6 views

Book node entity to set child nodes access permissions

I'm working on a simple permissions module for books. This module should make a book with its child nodes private. The toplevel content type is called reader than I have a child content type edition ...
-2
votes
0answers
13 views

How to style the webform submission pdf

I want to style the webform submission pdf files. I want to add a logo and a footer, also I would like to change the font. But I have no idea how to do this, so I need help for this issue.
0
votes
0answers
8 views

How to calculate two taxes for the same product?

Spanish taxes depends on the product but also on the customer. A product could have one of this taxes: normal (21%), reduced (10%) and super-reduced (4%). This is managed by a field on the variation ...
-5
votes
0answers
12 views

How can I start a test series in my website? [closed]

Please help me and tell me about how to start the test series or any best plugin that is suitable for it. My requirement is that the test is started after login. And it has a color code with total ...
0
votes
0answers
20 views

How do I add an help text icon next to a custom form element label?

I'm trying to add an information icon next to a custom form label. When users hover the cursor over that icon, it should display the label description. I know '#attributes' => array('title' => t(...
0
votes
0answers
22 views

Delete an account without showing the confirmation form

I've been working on creating a feature which allows certain non-admin but higher-than-user roles within a Drupal 8.8 system to delete users from the system. In essence, only admin and 'moderator' ...
-1
votes
0answers
13 views

JSON format missing [closed]

I'm using D7 with Services module. I have discovered recently that the JSON format on live server is not "rendered" differently: I don't know what has changed there, but the JSON output on ...
0
votes
0answers
38 views

Why does my custom block disappear after page reload?

I have created a custom block with a custom module (Example: https://www.webwash.net/programmatically-create-block-drupal-8/). The goal is to display some external content, which is working. The only ...
-2
votes
0answers
32 views

Ajax request to API in custom block each minute

I want to display a counter on a website with a block, that refreshes every minute. I have an API where I can get the counter-value. https://myapiwebsite.com/api/checkin/getCounter?token=mytokenvalue ...
0
votes
1answer
28 views

How do I get the image path inside a jsonapi response?

I a content type for movies that includes plain text fields, and an image. The field name for the image is field_movie_poster. Using the JSON API, How do I include the image path in the request? If I ...
1
vote
0answers
64 views

Clearing Cache related to user data

Drupal's cache system is a complete nightmare causing all sorts of issues with my user sessions. To provide a couple examples Our navigation header block contains a link that takes users to a ...
0
votes
0answers
11 views

will webform work with views bulk operations?

Given a webform that submits emails sometimes the destination mailbox might not be available. As far as drupal is concerned the submission was successful. I can resubmit individual submissions. I need ...
0
votes
1answer
12 views

Pass a webform value to a node via Rules?

I have a rule that is successfully creating a node of a content type when a webform is submitted. How do I pass a value from the webform into the created node via rules? (This is a Drupal 7 site.)
-3
votes
0answers
26 views

How to create an archive containing files with the Drupal interface? [closed]

When you reserve a domain name with a host, it offers a free space of 10 MB to publish a web page (this type of offer does not support PHP). I created a small 8MB website with HTML, CSS and JS (it's ...
-3
votes
1answer
26 views

Set a default integer value with #ajax, according to a form state value in the same form

There is an integer field: "Number of pitches" Another integer field: "Maximum people allowed". These will usually be the same values. I am trying to set the value of the field ...
0
votes
0answers
28 views

Multisite doesn't work after upgrade

I have a docroot with 2 websites, both share core and contrib modules. I have 2 DB, one for default and another for subdomain. Inside "sites" folder also have 2 different folders: default ...
-3
votes
0answers
22 views

Undefined function entity_load(), entity_access() [closed]

field_widget_instance(), entity_load(), entity_access(),!drupal_static(),locale_language_list(), get_token_context, format_variables $instance = field_widget_instance($element, $form_state); ...
0
votes
0answers
12 views

Large menu management options

I have a site with about 800 pages in the main menu. When creating or editing a node, managing the menu item parent can be challenging with a select list containing so many options! I am using Big ...
0
votes
0answers
11 views

unable to load the field_media_img properly within the bootstrap style

While creating a view I would like to add {{ field_media_img }} in a <div class="card-img-top">. Therefore I created a view with 5 fields, all "exluded from display". And a ...
-1
votes
0answers
15 views

Why does the Magnific Popup not show alt or title in bottom bar?

I have an existing site built in D7. I've created a new page that displays a views based grid of images of one specific content type. When you click on an image, magnific pop-up creates an overlay ...
0
votes
1answer
19 views

Success with cookie, fails with JWT: RuntimeException: Failed to start the session because headers have already been sent

My Controller is working with cookie auth but failing with JWT. This Controller is supposed to flag an entity for the logged-in user. If I am using cookie auth, there are no errors and everything ...
0
votes
0answers
14 views

Order confirmation email with custom order fields

I have added some fields to the order type and they are completed on checkout flow. I would like to include those fields in the confirmation email but I haven't found a way to get it on the twig ...
0
votes
1answer
24 views

Views rest export does not update

I have two websites. On website 1 I have a calendar showing upcoming events. Next to a regular views page I also created a views rest export page with 6, of the most near in the future, upcoming ...
1
vote
0answers
24 views

How can I have the file upload destination private by default?

Currently Webform file component uses public files as default upload destination. This is probably because private files path is not always available if not configured in Drupal settings correctly. ...
0
votes
1answer
10 views

JSON:API error unprocessable entity status 422 entity_id this value should not be null

I'm trying to post a flag with JSON:API but I'm getting the following error: "errors": [ { "title": "Unprocessable Entity", "status": "...
1
vote
1answer
31 views

Is there any way to show a “computed field” value in edit mode?

I have a content type (Structure) to which I added a text computed field. In a module I added the following code. function computed_field_field_reference_compute($entity_type_manager, $node, $fields, $...
0
votes
0answers
8 views

field widget form element not updating #attributes via #ajax callback

I am trying to do a simple update to a form element in my field widget, I have a start and a end dates in the field widget and I need the start date to be the min date of the end date, so I call an ...
0
votes
1answer
29 views

hook_views_query_alter() not working?

Very new to web development and even newer to Drupal, and I have some questions that I would really appreciate if anyone could answer! Here's my yml file, [Site name] is actually just the name of our ...
0
votes
1answer
19 views

Error trying to submit webform programatically multiple times: Duplicate entry for key 'PRIMARY'

I'm trying to programatically send submissions to a webform n times, but when I submit the submission info to the webform for the second time, I get an Integrity constraint violation: 1062 Duplicate ...

15 30 50 per page
1
2 3 4 5
1689