Questions tagged [10]

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

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

How to add a reset button to forms that isn’t a #submit type?

How do I add a reset button to a form? I have a form with a CKEditor and other fields, plus hidden fields. How do I reset the form so all fields are empty?
Cy Jobes's user avatar
0 votes
0 answers
13 views

Drupal 10 / Ckeditor 5 - Can't upload image : "Couldn't upload file: ..."

I need your help, I can't upload image with Ckeditor 5 in my Drupal 10.1.6 website (PHP 8.2), all other features works fine except image upload : In my recent upgrade of Drupal, I switched directly ...
PtitBreton's user avatar
-1 votes
1 answer
19 views

Migrating 2 fields into a link field

I'm looking to migrate two fields on D7 (one a link field, the other a text field) into a single link field on D10. The meat of the migration is here: source: plugin: d7_paragraphs_item bundle: ...
Scott Joudry's user avatar
  • 4,193
-3 votes
1 answer
51 views

How to unlink the site name?

Core with Olivero theme. The site name is a link and I want to unlink it. I want to do it because I already link to the homepage from the main menu and don't want two links to the homepage from the ...
ali's user avatar
  • 5
0 votes
0 answers
24 views

How to disable metatags for custom entity types?

I created a custom entity type, Fruits. I have the Metatag module enabled. I did not configure any settings to put metatags on the Fruits entity type, and it does not have a Metatag field. However, ...
Patrick Kenny's user avatar
0 votes
0 answers
37 views

What's the standard way of passing a return URL to a form?

The scenario is simple. I've constructed a Link object whose URL points to a form. I need a way to pass a URL to that form so that proper redirection can happen after the form is submitted. Passing a ...
ilechcod's user avatar
  • 113
-3 votes
1 answer
53 views

Is it possible to create an ecommerce website using the core alone? [closed]

I consider to create an ecommerce website using the core alone. Products will be categorized firstly by content types and any such content type could include fields such as: Price Material ...
ali's user avatar
  • 5
0 votes
0 answers
23 views

Custom CSS/JS combined to webform custom component gives type MIME error

I've made a custom Webform component, working well so far. A javascript library is attached to this component. $elements['#attached']['library'][] = 'my_module/my_lib'; My client tried to add custom ...
mt.i.1's user avatar
  • 53
-1 votes
1 answer
67 views

How can I compare date time values in a content form?

I want to use getString method instead of [0]['value'] how do i do that if possible and is there any other way? -This is the array i am getting when dump their values dump($form_state->getValue(...
Gaurav Gupta's user avatar
1 vote
0 answers
44 views

Minimum order amount

How to limit the possibility of completing an order less or more than the specified amount in Commerce 2? For 7 there was a module: https://www.drupal.org/project/commerce_moa but not for 8+...
VVS's user avatar
  • 221
-2 votes
0 answers
31 views

How do I upgrade webform forms? [closed]

Is there any approach to upgrade a Drupal 7 site dedicated to forms?
Matoeil's user avatar
  • 3,355
1 vote
2 answers
107 views

How to run global PHP?

More of a general understanding question then a problem to solve question. In Drupal core version 10.X.X, is there a PHP file in which a user can freely run global PHP commands that would effect any ...
ali's user avatar
  • 5
-2 votes
0 answers
53 views

How do i get all the fields just below there respective types when click on their respective checkbox in form?

I have to create a drupal10 custom form -> In this i have created a checkbox with all the content types and when i click on any of the content type the ajax callback occurs which fetch the ...
Gaurav Gupta's user avatar
1 vote
1 answer
33 views

Can we migrate and keep the same user, taxonomy, and node IDs?

When we are migrating a Drupal 7 site to Drupal 10, we have some custom tables which store taxonomy, node, user, and role IDs. Is their a way to migrate a content type preserving the IDs?
Anupriya's user avatar
0 votes
1 answer
89 views

Do content types play any role for ecommerce product webpages?

Content types (Node types) have always been a great way to organize Drupal content, especially when combining blocks in nodes of certain content types and/or certain node IDs or preventing them from ...
ali's user avatar
  • 5
0 votes
1 answer
102 views

Why does the forum_index table not have a primary key? Not having one interferes with the READ-COMMITTED transaction isolation level [closed]

I just updated a site to Drupal 10.1.6. To fix an error on the status page, I added the READ-COMMITTED Transaction isolation level to the database settings in my settings.php file. Now I have a new ...
leeksoup's user avatar
1 vote
0 answers
36 views

How can I create a custom "Add to cart" form?

I'm developing a basic Commerce shop with Drupal 10. The product type is clothing, which has a single product variation (product_size) and three different product attributes for that variation. The ...
SlowCheetah's user avatar
1 vote
0 answers
33 views

Avoid URLs contain the language code when the used language is the default one

I select the user language with the language code in the URL, as in https://example.com/zh-hans/node/1 or https://example.com/mysite.com/en/node/1. The default language is Chinese. How could I manage ...
Brian's user avatar
  • 157
0 votes
0 answers
23 views

Image styles are not created, when imported from nginx

I'm runnig Drupal on nginx. The nginx configuration file I am using contains the following lines. server { listen 80; listen [::]:80; server_name www.duxise.com duxise.com www.duxise.cn ...
Brian's user avatar
  • 157
0 votes
1 answer
84 views

Make a custom action with form

I am trying to make a custom user action where the selected users will have a node created manually, however I need to create a form to save the data that this node will have, such as: title, start ...
Juan Carlos Osorio's user avatar
0 votes
0 answers
43 views

Conditional dropdown select menu

I'm using the Webforms module for Drupal 10 and I am trying to create a form with 2 select boxes related to 2 content types: Content type: "Country" Content type: "City" I'd like ...
BMM's user avatar
  • 103
0 votes
0 answers
37 views

Deprecated RDF unintentionally removed

I am prepping my company site to move from Drupal 9 to Drupal 10. I am working with the Upgrade Status module to make sure the site is ready. In the process, I needed to uninstall the Core RDF module ...
Mitch Barlow's user avatar
-1 votes
0 answers
42 views

/sites/default/files css and js folders/files missing

I just installed Drupal 10. I've used web interface to install. /sites/default/files/js & /sites/default/files/css/ are missing. I'm running development environment on macOS. I've checked http://...
Raymond's user avatar
  • 99
0 votes
0 answers
48 views

What do I need to change in my code that uses ColorBox?

I get the following errors and I am unable to understand why. drupal.js?v=10.1.6:64 Uncaught TypeError: a(...).colorbox is not a function at HTMLDivElement.<anonymous> (nacolorbox.js:19:11) ...
Delford Chaffin's user avatar
0 votes
2 answers
72 views

Make a header of a view page to appear only in the view's first page

I have a view-page with a pager of about 10 pager-pages. This view also has a a view-header. The text of this header repeats itself in all pager-pages of that view, which is a bit funny because in ...
ali's user avatar
  • 5
0 votes
1 answer
41 views

Template suggestions are shows, even though all debug settings are off

We recently upgrade our Drupal 9 site to Drupal 10. The TWIG debug information now outputs all the template suggestions. We have all debug setting off (FALSE) in the the services.yml file. Of course, ...
quantumized's user avatar
  • 1,177
0 votes
0 answers
72 views

drupal 10 breaks Nginx with too many redirects even when nginx config is changed [closed]

HTTP ERROR 503 Can't open website when using nginx, why? drupal version: drupal 10.1 Linux: Centos 7 nginx version: nginx/1.24.0 mysql version: mysql Ver 8.0.33 website: http://duxise.com When I ...
Brian's user avatar
  • 157
1 vote
1 answer
105 views

How to list all content types by number?

I have a website with many content types and my problem is that counting the number of content types unlisted by numbers might be hard or confusing because of the high amount of content types. When in ...
webtech's user avatar
  • 21
-3 votes
1 answer
77 views

How to programmatically create a redirect and then get the redirect ID of newly created redirect? [closed]

I am trying to create a redirect programmatically, then reference the ID of that redirect from a node. I use hook node in my module with the following code to create a redirect. use Drupal\redirect\...
Jay Williams's user avatar
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 ...
webtech's user avatar
  • 21
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,...
veera's user avatar
  • 1
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 ...
Khaled development's user avatar
0 votes
1 answer
129 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 ...
Eluchel's user avatar
  • 329
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 ...
BMM's user avatar
  • 103
0 votes
1 answer
40 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 ...
Menno van den Heuvel's user avatar
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 ...
esod's user avatar
  • 309
2 votes
1 answer
151 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 ...
Binary Alchemist's user avatar
0 votes
0 answers
17 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 ...
lfccarvalho's user avatar
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 ...
blu's user avatar
  • 438
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 ...
arnoldbird's user avatar
  • 1,079
0 votes
1 answer
50 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 ...
irohit786's user avatar
0 votes
1 answer
94 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 ...
Anders's user avatar
  • 145
0 votes
1 answer
135 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: ...
aharown07's user avatar
  • 362
0 votes
2 answers
66 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. ...
hstoellinger's user avatar
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, ...
viewer's user avatar
  • 1
0 votes
1 answer
93 views

How to format a view to show content but without a teaser?

I want to format a View to show content but without a teaser. I can choose fields instead content but then I don't get all the CSS sytling I get with content. I can hide the teaser in the View page ...
viewer's user avatar
  • 1
1 vote
2 answers
71 views

How do I replace hook_field_widget_WIDGET_TYPE_form_alter() with hook_field_widget_complete_WIDGET_TYPE_form_alter()?

I've been using hook_field_widget_WIDGET_TYPE_form_alter() for years. And, of course, in Drupal 10, it has been deprecated. I am trying to add a hook to the file attachments widget. I just want to ...
SomebodySysop's user avatar
0 votes
1 answer
70 views

Getting rid of orphan role permissions

In the course of trying to uprade from D9.5 to D10 I face the following annoying problem: When I uninstalled the guestbook modules some time ago under D8 or D9, it didn't remove its permissions. D10 ...
hstoellinger's user avatar
0 votes
0 answers
66 views

How can I securely make a minor update?

Once in about a month I make a minor update using the following commands. cd website_directory chmod u+w web/sites/default composer update vendor/bin/drush updatedb vendor/bin/drush cache:rebuild ...
viewer's user avatar
  • 1
0 votes
0 answers
14 views

Rango de fechas: this field cannot hold more than 1 values when I try to sync content to a node with a date range field

I'm working with Feeds to sync content from a JsonAPI resource. Everything works fine except the date range field. I get dates like this from the source: 0 => "2023-10-27T00:00:00" 1 =&...
Oskar Calvo's user avatar