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.
1,630
questions
0
votes
0
answers
12
views
How to modify the timezone options list?
I have a date range field in a paragraph which is set to allow setting the timezone. Can someone suggest how I can alter the list of options used to select the TZ?
For the user profile form a simple ...
0
votes
0
answers
22
views
Drupal 9 stick comment on top
I need to stick specific comment on top of others which will remain from oldest to newest.
When it's stick on top it's replies must be with that comment.
So I made links in .module file which will ...
0
votes
0
answers
6
views
How to set view permissions for Content Type to be visible for autenticated users only?
I want a Content Type to be only visible for authenticated users.
Now the edit permission dialog only offers permissions for modification, not for displaying the published content.
Until Drupal 9, I'...
-4
votes
0
answers
16
views
How to add option to get YouTube Title and YouTube channel logo YouTube Field
I am using YouTube field module and its good module but I want to add YouTube title and YouTube channel logo. Currently there are only three option available.
1. YouTube URL - available
2. YouTube ...
0
votes
1
answer
30
views
How to display a block after renaming its id?
I have a custom block and want to change its id. But after renaming id = "main_menu_block" to "header_block", the block doesn't display.
Tried:
remove block with old id,
rename id ...
0
votes
1
answer
15
views
How to disable the option time_restriction that honeypot add to the forms
In the README file for the Honeypot module, it says:
If you want to add honeypot to your own forms, or to any form through
your own
module's hook_form_alter's, you can simply place the following
...
0
votes
0
answers
18
views
EntityQuery to filter values returned based on List(text) field
I have a List(text) field that can have multiple values. I am trying to create an entityQuery that returns nodes with specific items are checked within the field. The variable "availableServices&...
0
votes
0
answers
43
views
Not sure how to choose between Schema API and Entity API [closed]
I would like to save and then update data fetched from an external API every X minutes.
This data will then be used to display things on the client side.
What is the best practice to store this data ? ...
-2
votes
0
answers
45
views
How do I make a computed field editable?
I have to do some calculation in webform. Below is small part of my calculation form where I have fields like
Length (Number)
Width (Number)
Thickness (Number)
Volume (Computed Field) Formula
'{% if ...
1
vote
0
answers
12
views
Always charge the most expensive flat rate shipping in an order
I have a Drupal Commerce site with two product types. One has free shipping, and the other costs € 3,-. When both products are in the cart, the customer is allowed to choose either of those rates, ...
-1
votes
1
answer
48
views
Argument #1 ($config_factory) must be of type Drupal\Core\Config\ConfigFactoryInterface, array given
I'm writing a new module for the community and I have this error and I'm not understand what's going on.
The error:
Mensaje TypeError:
Drupal\view_mode_by_owner_role\Functors\ListOfNodeBundles::...
0
votes
1
answer
30
views
Creating a Custom Content Listing Page based on specific content type or taxonomy terms selected in the node
I am trying to create a content type that generates a list of content/nodes based on other content type or taxonomy terms selected within that node in the content type. I have a general content type ...
0
votes
1
answer
37
views
When a custom form is displayed in a custom template, ajax does not work
What I want to do
I want to display a custom form with a custom template and use ajax in it to change values in the form.
Problem
Custom template notation prevents ajax from working.
I didn't change ...
1
vote
2
answers
73
views
Why is the service “@url_helper” not found?
I am trying to add the query string with the each URL access through the browser. To accomplish it, trying to implement that through the service. But getting no solution in Drupal 9.
mymodule.services....
0
votes
0
answers
9
views
Can't Place Custom Block in BrowserTestBase
I'm trying to set up a test for my custom module. But I can't seem to place my custom block. I can place system blocks just fine. So I don't know if there's something special with a block I make in my ...
1
vote
1
answer
50
views
How to prepopulate the body field with the body of another node
I have a number of nodes that I use as templates, I clone them to create nodes with the same body text.
However, I want to make this process simpler by prepopulating the body field using a token that ...
0
votes
1
answer
24
views
Patch not working
I am trying to apply patch to the core file but none solution work for me. even not able commit core file changes due composer restriction
composer.json
{
"name": "pantheon-upstreams/...
-1
votes
1
answer
40
views
Exporting content from a very old site and importing into a new site
I have inherited a very old Drupal 8.3 site that is itself an upgrade from Drupal 7 almost a decade ago, and does a lot of things the old fashioned way using panels or external modules that now have ...
0
votes
1
answer
33
views
phpunit can't find node permissions
We have a Functional test class derived from BrowserTestBase which is passing, but the output includes a deprecation notice.
Adding non-existent permissions to a role is deprecated in drupal:9.3.0 ...
0
votes
0
answers
20
views
Report comments / Workflow
I am trying to implement a functionality that would allow authenticated users to report comments on a forum post. My first thought was to do it using workflows but comments dont have a workflow ...
0
votes
0
answers
16
views
Fetch redirect alias using the old alias
I want to get the current alias of the node using an old alias. I do have the Redirect module installed and all the old aliases of the nodes are mapped to the new ones. But I am not able to fetch the ...
0
votes
1
answer
52
views
tempstore.private not working in openIDConnect client
I am getting some licence info via retrieveUserInfo in the openIDConnect custom client login process. Ideally i want to write it to the session but opted for the "tempstore.private" since it ...
-1
votes
0
answers
22
views
What's stored with the APCu extension [duplicate]
I have the OPCache extension installed on PHP 8.1 (Drupal 9.5). Based on the status report recommendation, I have also installed the APCu extension.
I understand that the OPCache extension stores PHP ...
0
votes
1
answer
6
views
401 error when trying to retrieve OAuth authorization code
I'm building a decoupled Next.js frontend to consume data from Drupal JSON:API on a local site installed with Lando. I want to use the simple_oauth module to allow registered users to edit content on ...
0
votes
0
answers
13
views
How to prevent certain users or user roles from being able to send private messages to another user or user role?
With the Private Message module (https://www.drupal.org/project/private_message), I have pretty much found what I have been looking for. With this module, users are able to write private messages to ...
0
votes
0
answers
15
views
Save multiple taxonomy terms in migration from array of tids
I'm having some issues with storing multiple taxonomy terms in a field as part of a migration.
I've created a custom plugin get_colors that returns an array of existing tids. A custom process plugin ...
0
votes
1
answer
27
views
Deleted context link still exists in admin toolbar menu
I have deleted context but in admin toolbar it still showing . On main context admin page context doesn't exists. I have installed/uninstalled module - not helping
How do i remove that link from ...
1
vote
0
answers
32
views
"migrate:status" freezes on "Try to validate bootstrap phase 0"
Drupal community!
I am working on migrating from D7 to D9. Both are located on separate servers. I configured D7 database as db to migrate in my D9 settings.php, like this:
$databases['migrate']['...
2
votes
0
answers
38
views
CKEditor 5 - access PHP plugin configuration from JS plugin?
I have provided a CKEditor 5 plugin a PHP configuration class. I am able to set and store configuration for the text editor plugin now, but do not know how to access that configuration value(s) from ...
-3
votes
0
answers
28
views
Get AJAX button via AJAX
I've some controller, which returns Url::fromroute()->toString(), and it works in a template file, when I put it in <a class="use-ajax">. When I try to get it via AJAX, the link ...
1
vote
0
answers
36
views
How do I migrate 1000+ nodes iteratively with term hierarchy and links in a CSV file? [closed]
I run for almost 15 years now a Drupal website as a hobby. I had lots of help of the great Drupal commmunity with this. And was able to migrate from drupal 5-6-7 with the modules which were add hand. ...
0
votes
1
answer
20
views
Export product image with Commerce Cart API module
I'm usng the "Commerce Cart API" module on my website to build a custom cart js layer.
The problem i am facing is the purchased entity has a field_image field and I would like get the url of ...
0
votes
1
answer
18
views
Auto assign term to node from term field from user
I have a term field called "Organization" on both Content and User entities.
On the Content entity, the field for Organization is hidden.
For the user, they select a value for Organization.
...
-4
votes
0
answers
75
views
Error after upgrade, PHP from 7.4 to PHP 8.1 and some required contributed modules
I am upgrading from Drupal 8.9.20 to Drupal 9.5.5 and getting 2 following errors in drush updb
[Twig\Error\RuntimeError]
An exception has been thrown during the rendering of a template ("You ...
1
vote
2
answers
55
views
Hook post update not found
I have a problem with the drush updb command which does not find the hook post updates of my custom module.
I noticed that the module install saves the module's name string here in database, table &...
0
votes
1
answer
27
views
401 error when trying to retrieve OAuth access token
I'm trying to configure simple_oauth to use with local Lando install of a Drupal 9 site with decoupled React frontend.
I followed the instructions at https://drupalize.me/tutorial/install-and-...
0
votes
1
answer
20
views
Errors when providing or generating keys for Simple OAuth module
I'm trying to configure simple_oauth to use with local Lando install of a Drupal 9 site with decoupled React frontend.
I've tried to manually generate the keys in the terminal:
$ openssl genrsa -out ...
0
votes
0
answers
16
views
Can't get Plupload Integration test module to work
I've installed Plupload integration on my Drupal 9 local Docksal site but can't get the example module to work. The library is properly installed according to Status Report. I enabled "Plupload ...
0
votes
1
answer
15
views
Display the last page in a BOOK content type as a link?
I'm currently using the core BOOK content type as a form of discussions. I created a views page with all the books and titles exposed. But I also want to append the last page of the book in the Views ...
1
vote
1
answer
18
views
Display only search box with live search and no content with results
I have configured search API with autocomplete, the search box is exposed in a views block. But the block displays the default 5 results below the search box even if the box is not used yet. I want ...
-3
votes
0
answers
27
views
Navigation button events not working after requesting the javascripts from footer
In Drupal 9 I have find out that the modernizr and touchevents javascript files are requested from the header instead of footer. This causes a render blocking issue while monitoring my site using ...
0
votes
1
answer
49
views
Paragraphs field preprocess hook not called
To simplify this issue, I just have 2 hooks:
1. customtheme_preprocess_paragraph__registration_button()
2. customtheme_preprocess_paragraph__registration_button__default()
When I access a node with a ...
0
votes
1
answer
22
views
How to alter pagination url of embedded view programmatically?
I m trying to send mail which contain some data along with embedded view result programmatically. This mail is trigger on submit of webform. Webform ajax property is enable. Due to which it send ...
0
votes
0
answers
24
views
not able to use logger in a class /closed
I have a quick question. (drupal 9)
I'm working inside a custom form class (custom_module/src/Form), in a public function.
I want to log some values so I can debug, but the default Drupal logger is ...
0
votes
1
answer
19
views
How to show layout's label or description in a custom Layout Builder settings form
I have successfully made custom layouts and a custom settings form, something like this: https://www.codimth.com/blog/web/drupal/how-add-custom-settings-layouts-drupal-8-9
I want the custom settings ...
-1
votes
1
answer
64
views
How to include remote web page
I have a simple problem but can't find a simple solution. I want to include remote (dynamically created) web page into Drupal generated page. Previously i used PHP filter module in Drupal, so i would ...
1
vote
1
answer
47
views
Adding custom operations with hook_entity_operation()
I'm trying to add a custom entity operation to taxonomy terms of a specific vocabulary.
I've found documentation on using hook_entity_operation() to add the operation, and that works, but I'm not sure ...
-4
votes
1
answer
91
views
Why are terabytes of memory suddenly requested? [closed]
A couple of days ago I configured my server to use PHP-FPM to use different versions of PHP for different sites. After that they worked fine. Two Drupal 9 sites are using PHP 8.1, other Drupal 7 sites ...
1
vote
1
answer
44
views
Storing temporary data in a form AJAX callback
I have a form submit button that when clicked fires an AJAX callback.
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Title...'),
'#ajax' => [
'callback'...
0
votes
1
answer
49
views
How do I migrate Yii2 passwords?
I migrated users from Yii2 to Drupal 9, where there are password hashes like $2y$13$nhBZ37OKp27jJBLgRkFlOuL5ac8Bda5n2XIZTjKON5gKPfIcxh61y genereated by Yii2 with \Yii::$app->security->...