Questions tagged [9]

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

Filter by
Sorted by
Tagged with
-4 votes
0 answers
42 views

How can I add a "|" separator on the menu? [closed]

I tried adding an item on the menu that has this is as the title " | " and as the link but the line comes out too high and doesnt fit the entire menu. is there a drupal way to do this ...
Diana's user avatar
  • 3,282
0 votes
1 answer
36 views

Content type template takes precedence over specific node id template. How to change priority?

In my MYCUSTOMTHEME.theme file, I've added page template suggestion for specific content types and paths, so that I can use page--node--CONTENT-TYPE.html.twig to override certain pages. In ...
Tinto's user avatar
  • 61
-3 votes
0 answers
63 views

Getting the "Solarium @version is too old" error after upgrade

I recently updated a Drupal 9.3 site to Drupal 9.5 and most of the contributed modules were updated to the latest version that supports both 9 and 10 in view of an upcoming Drupal 10 upgrade. On the ...
Binny's user avatar
  • 890
0 votes
0 answers
56 views

Contrib module remove

I want to remove the content_sync module from my site. Firstly I uninstalled it with drush pm-uninstall, run a drush cex, drush cr and then removed it using composer remove. I removed also every ...
user7167081's user avatar
0 votes
0 answers
11 views

Add custom error text for Commerce Coupon

We have a coupon that is for shipping only. If user tries to apply it before they have entered address, then error is displayed: "The provided coupon code cannot be applied to your order". ...
betarobot's user avatar
0 votes
0 answers
73 views

How do I get <drupal-media> to appear?

I am trying to use the Drupal Media insert button in the CKEditor5 module. (Important - the existing images were included using CKEditor4 and are inline images, not using Drupal Media.) I upload the ...
Adaddinsane's user avatar
0 votes
0 answers
26 views

Hide Node Title if Paragraph Type Exists?

How do I hide node titles on pages only when a specific paragraph type is being used? For example, the paragraph field is "field_cta" and it has 3 choices of paragraphs "paragraph_a&...
Sam's user avatar
  • 583
0 votes
0 answers
38 views

How to use hasField but for paragraph fields?

Within a page template, how could I check if a paragraph field if present? I'm using this and it works: $node->hasField($field_paragraphfield) But how can I modify this to look for a field within ...
Sam's user avatar
  • 583
0 votes
1 answer
70 views

How to alter submission data when inserting a submission

I am trying to alter the data in a webform submission before this is being saved in to the database. In D7 i would do something like this: function mymodule_webform_submission_presave($node, &$...
hasse88's user avatar
  • 65
0 votes
1 answer
35 views

Entity reference to role

I want to add an Entity Reference field to a Group Type entity, referencing User Roles. When I add a Entity Reference > Other > Roles field, the creation/edition form of this Group Type throws ...
raistlinjoe's user avatar
1 vote
1 answer
91 views

How to override REST error message

After installing "RESTful Web Services" module, if I execute this API request: curl --request GET \ --url 'http://localhost/resourceNotFound?_format=json' I got following error (which is ...
Rami Sedhom's user avatar
1 vote
2 answers
89 views

How can I add a CASE statement in a WHERE clause?

I need to add a WHERE clause to the query altered by a hook_views_query_alter() implementation. The WHERE clause needs to contain the following CASE statement. $sql = "(CASE WHEN node_field_data....
Subhash's user avatar
  • 93
0 votes
1 answer
101 views

Hook for hiding menu links based on user access

I have a Drupal 7 module that uses hook_preprocess_menu_link() to hide menu links based on user access. I am in the process of migrating to Drupal 9, and it seems that hook_preprocess_menu_link() ...
Ali Rizvi's user avatar
0 votes
1 answer
104 views

Why does RedirectResponse not work on production server?

I have a very simple custom block/form that takes a user id and jumps to their profile page. The form submitForm has this: $uid = $form_state->getValue('uid'); $path = '/user/' . $uid; $response = ...
liquidcms's user avatar
  • 1,248
-1 votes
1 answer
134 views

What causes this error? 'You have requested a non-existent service "user.private_tempstore"'

I recently upgraded a site to Drupal 9. For content types that have media type as PDF documents, now I am not able to edit or save any uploaded pdf file. The drupal log shows this error. Symfony\...
9Lyfe's user avatar
  • 1
0 votes
1 answer
64 views

How do I upgrade from drupal 9 to 10 when dynamic entity reference 3.0 and up require drupal 10 first?

I am trying to upgrade my drupal 9 site to drupal 10. I installed the Upgrade Status module and it's only complaints are I need to upgrade linkchecker and dynamic entity reference. The problem is that ...
Eluchel's user avatar
  • 387
0 votes
0 answers
21 views

Kernel and functional testing with an MSSQL database

I am new to testing custom modules. My custom modules create and update custom nodes. From my reading, I need to use Kernel or Functional tests to test these operations. My Drupal 9 installation is ...
spacecraft96's user avatar
2 votes
1 answer
58 views

Removing data from an entity type

I am trying to remove a problematic payment gateway module and getting the following message when trying to uninstall it: There is data for the bundle Authorize.net (Accept.js) on the entity type ...
Ben Stark's user avatar
0 votes
0 answers
96 views

Error in Programmatically Creating Paragraphs with Layout Paragraphs

I am trying to programmatically create paragraphs using the Layout Paragraphs module. However, I'm encountering this error when saving the main entity that contains these paragraphs. I'm looking for ...
yorchperaza's user avatar
0 votes
2 answers
52 views

Adding a default text [closed]

Option 1: Is there any way to write a conditional in Twig that if field1 in Drupal is empty, I can set a default text to say "Bye" Option 2: I was also trying to use the conditional fields ...
kpe's user avatar
  • 1
0 votes
0 answers
56 views

I cannot install Geocoder

I have tried to install Geocoder v4.11 with composer require 'drupal/geocoder:^4.11' --with-all-dependencies, but instead I get incompatibility issues with Guzzle. Problem 1 - php-http/guzzle7-...
velvetInk's user avatar
  • 139
1 vote
0 answers
28 views

How does the RDF module impact user mapping when using the Acquia Migrate Accelerate (AMA) tool?

Before Acquia's AMA tool was open source, I used it on their platform to upgrade from Drupal 7 to Drupal 9. I am in the process of upgrading to Drupal 10 and want to uninstall the RDF module (don't ...
Shay97's user avatar
  • 11
-3 votes
1 answer
105 views

I am trying to install Drupal Commerce, I get error that prevents installation, I don't get what it says about ../private folder [closed]

Can somebody specify where this folder should exist? I created it in the directory containing the vendor directory, in the files directory, outside of the files and in the site root directory, but I ...
mevsme's user avatar
  • 1
0 votes
1 answer
47 views

How do I take the value of a variable from the node template and insert it into the field value?

In the template of the material type node there is a variable that adds and multiplies integers according to the formula, which I take from the filled fields of the node. Everything is working ...
Владимир Помелов's user avatar
0 votes
1 answer
83 views

How can I delete an existing path alias?

In Drupal 7, a path alias can be deleted with code similar to the following one. path_delete(array('source' => "problem/{$problem->nid}/{$problem_src->nid}")); How can I delete ...
Ali Rizvi's user avatar
-1 votes
1 answer
43 views

How to use the Tableselect element for an order-able list of items?

It's been a minute since I have used tableselect. I want to present a user with a list of sortable options that have checkboxes to indicate they are on or off. See this screenshot: While the table ...
Kevin's user avatar
  • 27.8k
1 vote
0 answers
31 views

How do I always show full search result pages in cases where some results are removed due to access restrictions?

I have a solr search index set up and a view to search content. We have "Region" groups for members so they only see content from their region. The search works great as admin who has access ...
James Prunty's user avatar
0 votes
0 answers
42 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: ...
lazarcelic's user avatar
0 votes
0 answers
48 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 =...
JonMcL's user avatar
  • 617
0 votes
3 answers
90 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 ...
gbmapo's user avatar
  • 1,066
0 votes
1 answer
127 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()) ...
gbmapo's user avatar
  • 1,066
1 vote
0 answers
65 views

How can I have both file download and redirection in for submit?

I have this form submit: public function submitForm(array &$form, FormStateInterface $form_state){ // File download $sFileName = 'JdP-Adhesion.pdf'; $sFileNameWithPath = 'sites/default/...
gbmapo's user avatar
  • 1,066
0 votes
1 answer
76 views

How to dispatch a ResponseEvent so that a cookie is added after login?

I want to add a session cookie when a user logs in. The previous implementation I had, was setting the cookie in hook_user_login with this snippet: $response = new Response(); $response->headers-&...
Maria Ioannidou's user avatar
0 votes
1 answer
110 views

Can create directories but can't upload files

When I try to upload a file with a file field, Drupal creates a sites/default/files/2023-10 directory, but can't upload the file. I see this validation error in the UI: "File upload error. Could ...
arnoldbird's user avatar
  • 1,173
0 votes
0 answers
18 views

View File Uploads in Custom Module Admin Screen

I'd like to show a list of the files in a directory in my default/files directory. This will show's all files: /** * Helper function to retrieve and display a list of current uploads. */ protected ...
jasonflaherty's user avatar
-1 votes
2 answers
106 views

How to add a link to table row?

There is a field 'field_upload_artwork' that contains files. I am using them to build links to files and want to insert links after Apparel Printing in the last step of the form. Now the markup in ...
nathan111777's user avatar
0 votes
0 answers
25 views

Email field is not migrated

I am trying to migrate an email field from Drupal 7 profile2 (don't think that matters) and it becomes blank on the Drupal 9 instance. The remaining fields migrate without any issues. My process ...
user111465's user avatar
0 votes
1 answer
62 views

Why doesn't my completion message show?

I have this form to handle a custom content entity: created by this code: public function buildForm(array $form, FormStateInterface $form_state, $contractId = NULL) { Some code to inialize ...
gbmapo's user avatar
  • 1,066
0 votes
1 answer
23 views

Promotion options not visible to Editor role

I have a "Editor" Role with limited access rights. It can basically only create blog type nodes. I'd like to expose to them the possibility to make to publish the node to the frontpage via ...
Andreas's user avatar
  • 392
1 vote
1 answer
109 views

Stylesheets not loading

Has anyone successfully dealt with this kind of error? [Error] Did not parse stylesheet at 'https://*****.***/core/assets/vendor/jquery.ui/themes/base/core.css?s2pf9q' because non CSS MIME types are ...
Cary Gordon's user avatar
1 vote
1 answer
54 views

How to add extra validate hook to the order information form?

I am trying to collect additional information on checkout to add to the order. I have added new fields to the order entity and then used hook_form_commerce_checkout_flow_multistep_default_alter to add ...
liquidcms's user avatar
  • 1,248
0 votes
1 answer
117 views

Why does Ajax prevents managed_file to be displayed?

I have this form created by this code: public function buildForm(array $form, FormStateInterface $form_state, $contractId = NULL) { some initialisation code... $database = \Drupal::database(...
gbmapo's user avatar
  • 1,066
0 votes
1 answer
140 views

Passing variable from parent paragraph to children without using getParentEntity

I have a paragraph called Boxes which is a parent paragraph referencing to many paragraphs of type Box. I have written the preprocess function of paragraph Boxes which contains some logic that can't ...
Mira chalak's user avatar
0 votes
1 answer
51 views

Order is not geting created, but transition is happening in cart

I am doing an Offsite redirection payment with Drupal Commerce. I have a custom payment workflow defined in my_module.workflow.yml as follows: order_linktypeplus_validation: id: ...
KTM's user avatar
  • 2,362
1 vote
0 answers
47 views

Add cancel button to Inline Entity Form/Entity Browser dialog

We're using Inline Entity Form to give users the ability to create new nodes of a different content type and add them to the being edited/created node. When using one of the IEF widgets, there's a ...
fallenturtle's user avatar
0 votes
1 answer
100 views

How to have views exposed filter value show as different value in the url?

I have a search page with a Views exposed filter for the name of a taxonomy term. I have added an #autocomplete_route_name to the form element to make this an autocomplete selector for my term names. ...
liquidcms's user avatar
  • 1,248
0 votes
0 answers
20 views

Prevent view results duplicate caused by workflow transitions

I have a view that lists content fields and it works fine, but, if I want to add a workflow field to the result (I have a field called reject_reason attached to workflow), I added workflow transition ...
Abdulmuhaymin's user avatar
0 votes
1 answer
76 views

Custom Field Type Checkboxes

I'm trying to create a custom FieldType. I've found many example with a textfield. But I want a custom field with checkboxes. I'm having a hard time finding an example like that. If anyone can help me ...
xpersonas's user avatar
  • 532
1 vote
0 answers
30 views

Disable drag/sorting for Entity Browser

I'm using Entity Browser and the Inline Entity Form module with Drupal 9. Right now when you view the form it shows you the currently existing values with options to edit and remove. The thing is that ...
fallenturtle's user avatar
1 vote
1 answer
463 views

why is index.php added to URLs?

Since I updated my site to Drupal 9.5.11, 'index.php/' is added to every URL: http://mysite.org/index.php/ for the home page, for example. On some page, I have a list with links to files and, because ...
gbmapo's user avatar
  • 1,066

1
2 3 4 5
36