All Questions

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

Feed's Regex find replace problem

Hello Drupal community, I'm finding some issues in a tamper used in feed's module. I want spaces to be deleted in a field that contains numbers. Something that changes "00 00 00 00 00" into "...
3
votes
0answers
51 views

How do we programmatically place a section and then a block in that region on module install?

We are looking for the best way to export a defined/built layout with inline blocks and then use that to programmatically set both them during a module install. eg. module install create node in ...
0
votes
1answer
8 views

Feeds: How to import content from multiple xml files

I have around 100 xml files. Each xml file contains a single item. I have created a feeds importer which is working fine for single xml file. But I don't know if feeds can work with multiple xml ...
0
votes
2answers
2k views

How to sort by condition in entityQuery

I want to get a list that the items with a specific term in the top (like promote). The query would be like: $query = \Drupal::entityQuery('node') ->condition('status', 1) ->condition('type'...
0
votes
0answers
6 views

Difficulty with checkbox boolean feature

Our stakeholders asked for a feature where they can "pin" blog posts (basically the "sticky" feature, but I'll use the term "pin" and "pinned" in this question), where certain posts that they select ...
0
votes
0answers
5 views

Block or ban ip addresses based on site-wide contact form category

How to create a rule with the Rules module that blocks or bans ip addresses based on the category that they selected on the contact form for anonymous contact submissions via the site-wide contact ...
-5
votes
0answers
18 views

Paragraph ordering [on hold]

Drupal 8 (possibly be Drupal 9 be completion of project) I have a set of data that will be in paragraphs, simple date & text fields. These need to be ordered in groups which do not have to ...
0
votes
1answer
32 views

Show rendered node in jQuery modal through JSON

Whenever a link has a specific class I want to show it as a jQuery modal. I have added the neccesarry data attributes to the link in order to be able to use it as a modal. I have also created a route ...
0
votes
0answers
46 views

Using Layout Builder with Menus

I followed this tutorial but am having some issues. I enabled menu_link_extras and layout_builder on my site. I enabled layout builder on my menu, added a menu link and added a block to that link's ...
4
votes
2answers
1k views

How do I filter by node ID in views?

I am trying to add Node ID in contextual filters but it seems there isn't Node ID anymore.
0
votes
2answers
27 views

Defaulting a value for a new boolean field added to an existing content type with content?

We have a Drupal 8 site. For one of our features, I added a boolean field called 'Pinned' to a our Blog Post content type. As I added the filed as a filter criteria to views, I noticed that, no ...
-3
votes
0answers
8 views

How does accessibility compliance in Backdrop CMS compare with that of Drupal 8? [on hold]

One of the benefits of Drupal 8 was to enhance compliance with Section 508 accessibility requirements. To what extent does Backdrop match Drupal 8 regarding those improvements? Do those ...
5
votes
4answers
5k views

What could be causing drupal to want to reinstall itself after I clear cache?

I have a very weird situation I have no idea how to even start to debug. I uploaded a copy of my site from a test server to my production server. Everything installs fine, I actually see the site ...
0
votes
0answers
9 views

How to change where the sqlite database is generated when running tests?

When running tests, I have some .sqlite files and tmp files created in my project root while the test is running. This causes my IDE to go crazy. Is there a way to tell Drupal in phpunit.xml to store ...
0
votes
1answer
1k views

How to handle free and paid orders with post processing?

I'm going around in circles trying to use Drupal Commerce to make an ecommerce site where some orders cost money and some don't (because some users have coupons that make products free). I've set up ...
-2
votes
1answer
35 views

How can I change the taxonomy term title?

Simple as that. I want to change the H1 tag from taxonomy views to something like "Articles from %term" to make it more user friendly and not redundant (breadcrumbs shows the term alone). I couldn't ...
2
votes
2answers
6k views

How to access session in twig?

I wondering how to access to session in twig ? In my Controller I have this part of code : $tempstore = \Drupal::service('user.private_tempstore')->get('mdm_user'); $tempstore->set('...
-2
votes
0answers
25 views

Calendar/datepicker popup not working on safari

$form['date']['air_date'] = array ( '#type' => 'date', '#title' => t('Air Date:'), '#required' => TRUE, '#default_value' => !empty($arr['air_date']) ? $arr['air_date'] : '', ); ...
1
vote
2answers
14 views

Query fieldCondition for custom content type

I am attempting to query a custom content type called players (machine name) in a Drupal 7 module and it seemed to be working fine up until an hour ago. Nothing has changed on my side but now the '...
0
votes
0answers
10 views

Contact message entitytype missing “id” parameter after 8.7.6 update

I'm updating site from 8.7.1 to 8.7.6, and I'm getting strange error: Error: Call to a member function getType() on null in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->...
1
vote
1answer
427 views

Define permissions for Actions?

function custom_mod_action_info() { return array( 'custom_mod_delete_user_cats' => array( 'label' => t('Delete a users cats'), 'type' => 'user', 'configurable' => ...
0
votes
1answer
15 views

UTF-8 encoding when creating nodes (from mails)

I'm making a customized version of the Mailhandler module, which has a node creation function: protected function createNode(MimeMessageInterface $message, DefaultAnalyzerResult $result) { $node =...
-2
votes
1answer
21 views

How to add file to root in multisite installation?

I have a multisite setup. public html - Sites - - All - - site1.com - - site2.com etc. I need to .txt files to the root of each website such as site1.com/ads.txt or site2.com/robots.txt If I ...
1
vote
1answer
436 views

How to use the same EntityListBuilder for entity A and an extended version B

I have used the content entity example coming from the example project. This example define a Contact entity. Next I have extended this Contact class in an Artist class with some added fields (let ...
1
vote
2answers
109 views

Strip HTML tags from validation errors

I am using Services 3.x for creating web services for mobile application, and I am using the JSON format. The validation errors given from the user register services comes with HTML tags; for example ...
1
vote
3answers
1k views

How do I update a user profile with entity_metadata_wrapper()?

I got an error while updating user profile data such as name,password and email. I am using entity_metadata_wrapper() for processing update. exception 'EntityMetadataWrapperException' with message '...
0
votes
1answer
1k views

Display blocks on taxonomy and content type pages

I have a taxonomy menu block. I need to show this block on some taxonomy term pages for a particular vocabulary and on some content type node pages in second sidebar region (bartik theme). How can ...
0
votes
1answer
31 views

How to add file extensions while creating a field (type file) through the module installer.yaml?

I need to add 4 fields to an existing content type in Drupal 8 website, 2 of them is text another 2 is file type, I have a multisite setup and have 30 country-specific sites so I need to add for every ...
-2
votes
0answers
14 views

facing problem files are not downloading on android mobiles [on hold]

i am using drupal7 for my website. also i have created web view android and IOS app for my website. files are downloading properly on laptop, pc, and IOS app. but on android mobile files are not ...
0
votes
1answer
403 views

Is it possible to pass parameters in a taxonomy term's aliased URL using clean URLs?

I am trying to pass URL parameters and access them in a preprocess function. I have done a fair amount of research but did not find an answer. It works if I do the following /example?id=1, but that's ...
0
votes
1answer
34 views

Alter existing route's output formats?

I want to alter the entity.node.canonical route so that when it is accessed using ?_format=json it will return the rendered node in JSON. So far I have created a RouteSubscriber that alters the route ...
4
votes
2answers
16k views

Get current language in template

In Drupal 7 the current language is a global variable we can access with global $language; $langcode = $language->language; I want to know how can we access the current language in a Twig file ...
1
vote
0answers
38 views

How to switch between views displays through ajax

I do have a view with exposed filters and a quite hierarchical architecture of the data which demands multiple grouping and sorting criteria. because of different use cases, users need to change the ...
0
votes
2answers
25 views

Hide one form element until another is selected

Is there any way to disable the field 'model_article_nr' until 'model' is selected this is what i have and as it is now i can select 'model_article_nr' before i have choosen a model which leads to ...
0
votes
2answers
1k views

Grab Node ID from URL of Current Page?

How do I grab the Node ID in the URL of the current page and pass it through a link? 1) The URL on the current page is in the format: website.com/parameter/parameter/parameter and the third ...
0
votes
1answer
18 views

Add second expression to query

I have a probably trivial question, but I could not find an answer. I have this query, which works fine: $query = db_select('books, 't'); $query ->fields('t', ['publication_year']) ->...
0
votes
0answers
15 views

Maestro Module with REST API

Developing a headless Drupal application. I am using maestro module in Drupal. I need to expose and invoke tasks(in maestro module) through REST API. Each task has handler(execute button) which should ...
1
vote
1answer
2k views

How to get the node from the url referer?

I have a custom entity named Application that has an Entity Reference field named Product. When I am on an Apllication page and click on a Product to see it, I would like to know that I come from the ...
0
votes
1answer
869 views

How do I loop over result rows and return calculated values?

I cannot get proper results from View PHP field. I've set up a Flipped Table view of entity form submission of which I'm trying to calculate "results" (sum and count(for avg)) with following code $...
0
votes
0answers
10 views

Views exposed date filter range format

I have a view with an exposed filter for a date range. I use jquery ui datepicker to select dates. It works good and I can select dates in spanish format (dd/mm/yyyy). But when I apply the filter, It ...
0
votes
1answer
396 views

Prevent redirect after submitting the form

In Drupal 7 profile2 module, want to make profile2 edit form to stay on the form itself after clicking SAVE button. With the following code, it stays on the form itself and displays the values ...
-2
votes
0answers
13 views

Contextual filter: Content: Nid issue [on hold]

I trying to make a views of my new products using contextual filter :Content: Nid. In content nid I opted provide default value and type:Fixed value. On Fixed value field only 27 values are added ...
0
votes
0answers
869 views

How to populate select options after ajax call on other select tag?

I want to change options of select on custom form after ajax call on other select. For example, let's assume that I have select (let's call it vehicles) options of vehicles like car, train, bicycle ...
0
votes
1answer
408 views

Form submission confirmation popup ( a variant of )

I have a lengthy node form. When the user clicks 'Save' I want them to be asked a further question which causes a flag field to be set or unset. For instance upon node form submission the user is ...
1
vote
1answer
776 views

Extracting UID information from a URL and sending email to this user

As a beginner, I would be grateful if this community could help me out to solve the following problem, by giving me some pointers. This is the scenario I would like to implement in Drupal (I guess I ...
0
votes
0answers
13 views

Unset cell item if field is true on a view page

I have a Views Table Page in Drupal 8 that displays node titles. On the node, there's a checkbox field that when checked needs indicate to the Views Table Page that title is not to display. I ...
1
vote
2answers
1k views

How to use arguments in Path Breadcrumb?

I am using the Path Breadcrumbs module to create breadcrumbs. I don't fully understand how to use arguments and selection rules, and thus I'm not sure how to create the following breadcrumb: On the ...
2
votes
4answers
9k views

How do I fix this Configuration Directory sync error?

I can't get past this error while installing drupal on my localhost. I've chmod'ed permissions on my core /default directory. I've: /default on 755 /default/files including all subfolders and files ...
0
votes
2answers
757 views

Feed Import Error

This import was working, now I'm stumped on why it's breaking. An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /batch?id=79&op=do StatusText: OK ...
0
votes
2answers
2k views

How to load customer profile from address module (commerce)

I'm using Drupal 8 with the module Commerce and I have an issue with the customer address. I'm developing an export custom module in D8, and I'm stuck trying to load the profile (to access billing ...

15 30 50 per page