All Questions
87,482
questions
0
votes
2
answers
57
views
How do I change the input type created by views daterange filter?
I am using a view created with the views module. The view displays all change requests, and I wanted to expose a filter to users to be able to filter the change requests by date.
The change requests ...
-3
votes
1
answer
66
views
How to reference a class with a use statement? [closed]
Inside a function in a controller class, I have the following:
$form_state = new \Drupal\Core\Form\FormState();
It works, and produces a new instance of a FormState.
Codesniffer is not happy with ...
0
votes
1
answer
13
views
What permission controls access to "webform_html_editor" input type?
I'm a Drupal site owner, and my admins cannot access any webform_html_editor elements.
The administrators have full access to all wysiwyg inputs, but there is no permission obvious to me that controls ...
0
votes
3
answers
77
views
Is it possible to override config in settings.local.php by prepending/appending to the current value?
I have tried both of the following:
$config['my_module.default']['content'] = 'prepend ' . $config['my_module.default']['content'];
$config['my_module.default']['content'] .= ' append';
but the ...
0
votes
0
answers
39
views
How to run batch in modal
How to run batch in modal
I have rendered link "Run batch" at twig level, click on it form open in modal
click on submit button batch run, but it's redirected to batch page
Desired ...
0
votes
0
answers
36
views
Trusted host patterns problem, again
I need to set up trusted host patterns for 3 EC2 instances. They all share same base code, so they all use the "same" settings.php.
On my two (production) instances everything works fine:
...
0
votes
0
answers
28
views
Change View webform link edit to edit/all
I am currently using drupal 10 and I created a page using View (acquiring webform with pages). In View I add link edit webform.
When I click edit, it can open the submission as expected. However since ...
0
votes
0
answers
35
views
Create view for inline images
I know how to create a view that shows only images.
Is it possible to create a view that also includes all inline images?
1
vote
2
answers
117
views
Inform the user what page of the pager it is -- on top of the page as well
When we create a View of pages we can give it a pager. That pager typically appears underneath the view. This can cause an accessibility problem of a user mistakenly clicking to go to a next page ...
0
votes
0
answers
56
views
How can I get the error message when a user account has not been successfully saved?
I'm trying to build a rest API to provide my mobile team to register a user using mobile app. I'm using www.example.com/entity/user for rest API as POST.
I'm able to create the user, but in some cases,...
0
votes
0
answers
48
views
Change theme based on user role [duplicate]
I have a scenario where I want to change my website theme based on user's role. Administrator users would have the Claro Claro, while content editors would have a custom theme or a downloaded theme.
I ...
0
votes
1
answer
144
views
I am trying to upgrade and Composer is complaining. How do I figure out what the actual issue is and fix it?
I am trying to update my Drupal 9 site to Drupal 10. I installed the Upgrade status module (and removed it before trying to update); my site is good with the exception of updating the Dynamic Entity ...
0
votes
0
answers
22
views
Acessing referenced entity as a token to use on email notification
I am using Drupal 10 and Rules module. I have created a rule to trigger when a new content of type "A" is created. That content has a reference to another content type, "B".
I ...
0
votes
0
answers
33
views
Is there any way to use EntityQuery on entity_reference fields in reverse?
Let's say I have two custom entity types: entity_one, entity_many.
I know how to use an EntityQuery to find entity_one matches if there is a multi-value entity reference field on entity_one.
$results =...
0
votes
1
answer
22
views
Prepopulating a drop-down select box that references another entity
I have a node create form for content type "space" so that the URL looks like https://.../node/add/space.
In this page, there is a form with a drop-down select that corresponds to an entity ...
0
votes
1
answer
44
views
Set a dynamic meta title on Node with MetaTag module installed
I've got one specific node where I need to dynamically set the meta title. The logic to determine the correct title is too involved to express in tokens; I need to do it in code.
It seems that I ...
1
vote
2
answers
39
views
Permissions to edit user field data, but not fields itself
How to allow a role to edit/manage user accounts e.g. click Edit and change email, username, password etc., but do not edit the fields itself, e.g. cannot just go to Manage fields and delete/create/...
0
votes
0
answers
29
views
Filtering dropdown selectable values depending on the selected value on another dropdown - in a content creation page
I have 3 content types: "Floors", "Spaces" and "Resources".
One floor can have multiple spaces, and one space can have multiple resources.
"Floor" has only a ...
-1
votes
0
answers
60
views
How to create and return a file generated by mPDF from a form submit?
I want to create a demo pdf after a form submit. I have used mPDF library and run composer require mpdf/mpdf to install it. Currently the library is installed in ROOT_FOLDER/vendor/mpdf.
Now I have ...
1
vote
0
answers
54
views
How to prevent HTML entity encoding in Drupal attribute objects?
Is there an easy way to disable the HTML entity encoding of CSS class names?
When I create CSS classes with ampersands or the "larger than" symbol (which might look strange but is ...
0
votes
0
answers
46
views
setElementData() on link element
How do I call setElementData() on a link element? The following code doesn't work.
$submission->setElementData('link_element', ['title' => 'string', 'url' => 'string']);
I get this error ...
0
votes
0
answers
36
views
How do I style the tooltip that displays element title on hover?
Background
I am building a custom Drupal theme for my site. For the most part, the styling is pretty straight forward, but I am struggling to find what js or css controls what appears to be a tooltip ...
0
votes
1
answer
18
views
How to configure a multistep webform with custom alias to use GET instead of POST
I have a multi step webform, which I'm using as a kind of configurator. I want to allow people to share the link, so they can land on the last page of teh form with all the other values already set.
I ...
-1
votes
0
answers
25
views
Change the user that submits the form
I have to give the user access to modify the "Submitted by:" and the module does not allow me to do so, so that the administrator user of this form can change the sending user
0
votes
0
answers
51
views
How do I get form elements with multiple values to display only one/single field with the add more button?
I expect what I'm asking is supposed to be the default behavior of form elements where users can input multiple values, however when I have a form element that has 3 or more allowed input values, a ...
2
votes
1
answer
152
views
Custom field type - cardinality unlimited - multi column - radios to select default/primary
I created a custom field for the CRM project to handle telephone numbers. It has multiple properties. I am having trouble getting primary to work; I want to be able to mark one of the telephone ...
0
votes
0
answers
69
views
Query condition with entity referenced via custom field
We have the usual way to reference related tables through JOINs using:
$query->condition('foo.entity:type.bar', $value);
But how can this be specified when foo is not a direct field but a complex ...
0
votes
0
answers
18
views
Submission of programatically added fields in webforms
I have an ever-increasing set of hidden fields that should be added to every form in my site.
I created helper update-hook functions to add new fields to the form, but now forms have too many fields ...
0
votes
1
answer
58
views
How to use 'required' and 'optional' states with form api when using a select field?
I'm trying to create a form in Drupal 10 that will show an field that is both visible and required depending on the selection of a radio input that comes before it. The visible state seems to work ...
0
votes
1
answer
86
views
How to join the node table with the url_alias table in a dynamic query?
Joining the node table to the url_alias table requires CONCAT. Here is an example of how this can be done:
$results = $db->query("
SELECT
n.nid, n.title,
a.source, a.alias
FROM ...
3
votes
1
answer
174
views
How do I inject a dateFormatter servide into a service class named MyService?
I have a service class declared like this:
class MyService implements MyServiceInterface {
I want to get rid of a (working) call to a the static \Drupal::service('date.formatter') function and ...
0
votes
1
answer
56
views
How can I programmatically stop webform from sending an email?
I need to stop sending my webform submission email programmatically and conditionally. By conditionally I mean I have two contact forms and two locales on my Drupal application. I have a custom ...
0
votes
0
answers
48
views
Getting errors after using Layout Builder
The rest of the site works as expected.
This is the error I get when trying to access content from the http://barrio.local/admin/content link.
Warning: Undefined array key 0 in C:\xampp\htdocs\apps\...
-2
votes
0
answers
17
views
When I integrated simplesamplphp 2.0.6 with drupal 9.5.11 (simplesaml_auth 3.3) , website went down and getting below error "This page isn’t working"
I have installed simpleamplephp and integrated with wso2 it is working fine. but when I try to integrate simplesamlphp with drupal using simplesaml_auth I'm having issue.
In my settings.php i have ...
1
vote
1
answer
124
views
Caching of entity UUID in a frontend form
I have a form which is displayed in the frontend, through which anonymous users can create nodes. For guest users, the pages are cached and with them apparently some part of the form. We recently ...
-2
votes
1
answer
55
views
Commerce module can't be enabled [closed]
I have installed the Commerce module but when I want to enable it, it does not give me the opportunity to check the checkbox, do you know how I can solve it?
0
votes
3
answers
82
views
How can I have updated content entity data immediately available after update?
I created custom content entities to handle a small NGO membership (Member, Person, both linked to Drupal 'users').
I have a form allowing users to perform online membership application.
Submitting ...
0
votes
1
answer
96
views
How can I set a custom project directory structure?
For Drupal 10 there's a recommended project structure (httpdocs/web, httpdocs/vendor) and a legacy structure (httpdocs, httpdocs/vendor). These are suitable for sites on shared hosts that provide SSH ...
0
votes
0
answers
25
views
Shipping cost is not up-to-date on the order_information page. Checkout page displays shipping properly
It's a Drupal 8 Commerce site, and we just changed the shipping rate from 2,90 to 3,5€
Although the shipping rate appears just fine on the checkout/####/review page, On the checkout/####/...
1
vote
1
answer
153
views
Upgrade to Drupal 10.1.6, Theme Doesn't Load Outside Maintenance Mode
I'm working to upgrade a site from 9.5.11 to 10.1.6. I followed the instructions provided here:
https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-later/upgrading-a-composer-based-...
0
votes
1
answer
59
views
Expose View of Visitors information via JSON:API
I've enabled the JSON:API Views module to expose View data via the JSON:API. I've created a page view of Visitors data. Preview data suggests that there is data available. The view is set to be ...
0
votes
1
answer
43
views
How can I render a Paragraph field in the views unformatted template?
I'm simply trying to render a Paragraph field from my content type in a view template. It's insanely difficult! I have the field setup to display the rendered entity, but how do I set it up in my ...
0
votes
1
answer
39
views
Respond to "dialog:afterclose" once
I'm trying to figure out how to respond to dialog:afterclose only once, and I'm not having any luck getting the syntax right (and I'm having trouble finding resources because most search results refer ...
0
votes
1
answer
71
views
How can I render only a region in a controller?
I'm looking to have a page on /templates/header which only renders what there is in the header region of the theme. I am using the following code for a custom controller.
namespace Drupal\...
0
votes
1
answer
113
views
Why is my message not showing for anonymous user?
In a custom form, I have this Ajax submit:
public function ajaxSubmit(array &$form, FormStateInterface $form_state) {
$response = new AjaxResponse();
if ($form_state->hasAnyErrors()) ...
0
votes
0
answers
28
views
How can I upload file in a webform field through an API using Postman?
I created a webform with a File element called attach_resume_cv inside it. I want to create an API for uploading the files in that webform.
In my_module.routing.yml file I created next route:
...
0
votes
1
answer
150
views
Updating Drupal 9.5 to Drupal 10 fails with php errors: what should php include path be?
I am attempting to update a Drupal 9.5 site to Drupal 10.
Upgrade status says 100% ready
PHP is 8.1.25
Webserver is nginx 1.18
MYSQL is 8.0.35-0ubuntu0.22.04.1 - (Ubuntu)
Following instructions here: ...
0
votes
2
answers
73
views
I don't see Bartik as theme to enable
I have reached a "screeching halt" trying to upgrade D9.5 to D10. So, I thought it might be better to "simply" start afresh with "vanilla" D10 and migrate stuff manually. ...
0
votes
1
answer
133
views
Extended CKEditor 5 toolbar appears cropped when editing a section-block
Anytime I try to edit a Layout Builder section-block with an expanded CKEditor 5, the toolbar is cropped.
This is probably a bug and may have to do with Right to Left languages like Hebrew or Arabic, ...
0
votes
0
answers
45
views
How create a custom views contextual filter?
I've a site using Drupal 10.1.x.
I need to implement the following requisites:
Let the users choose their "most liked" nodes (bundle product).
This bundle has a entity reference field to ...