All Questions

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

How to import image using CSV user import?

I already success to import user and node, but the image is not imported. I also write the path in csv to the file public://xxx fullpathHttp://xxx and i've done upload the img to the server first, ...
0
votes
0answers
6 views

How can I get the address components from Commerce store entity?

I have an address field in a form I'm building with the Form API. I need to pull the address components from the Store's instance so I can set them in my form. I can pull other fields from from the ...
-2
votes
0answers
8 views

.htaccess is overwritten every time I make an edit [on hold]

My web server does not allow "Options" in .htaccess, but the file is always rewritten if I change or delete it. How do I make Drupal work?
0
votes
1answer
18 views

Variables injected or set in a Twig file are undefined after the first position of an entity reference field

I have a Paragraph setup that has an entity reference field allowing an editor to select multiple nodes to use in a display. Based on the count of nodes, I want to trigger a class. I figured a way to ...
0
votes
0answers
16 views

How to get entity Translation's title in Twig

i am trying to get row title -node title- in my custom module with template_preprocess_modulename_view($variables) and views-modulename-view.html.twig with using row.content['#row']._entity.title....
0
votes
2answers
20 views

How do you hide a page?

I'm using Drupal 7, can you tell me how to hide a page if the page does not have a menu settings at the bottom?
0
votes
0answers
14 views

Displaying associative array data in twig

Using drupal 8.7.x I have an associative array that is returned to twig. However I can't seem to get the data displayed. Associative array: array_push($mealsArray, ["meal" => [ ['...
0
votes
0answers
11 views

How can I create a user with a term reference field in a Behat test when using the Drush Driver

My Behat test has the following Given statement. (field_regions is a taxonomy reference field) Given users: | name | mail | roles | field_regions | | Joe User | joe@...
0
votes
0answers
6 views

How to print in views field template the url of a multi field image?

I would like to print in a views field template the url of each image of a multi field image. This is my code but print only the URI $vals = $view->field['field_property_slideshow']->get_value(...
-3
votes
1answer
14 views

Transfer Aegir site to LAMP

Can anyone please advice me on how to move a Drupal 7 site from Aegir to a LAMP stack? I've been handed the emergency project of moving a site to a new hosting. Ordinarily, that would be easy enough ...
0
votes
0answers
19 views

Import Submissions Permission for specific Role [on hold]

I'm using Webform Submission Export/Import [EXPERIMENTAL] submodule which seems pretty useful. My use case require to have specific roles to be able to upload their own CSV submissions and I cannot ...
0
votes
0answers
12 views

Node visibility not working?

I'm working on a site where I want to control node visibility for a content type called 'Dataset' by membership in organic groups. However, this does not seem to be working... OG Field Settings for ...
0
votes
0answers
9 views

Entities of type Group and Group_Type are deleted when running drush updb or drush rr

I am using the Group module combined with a feature module. The feature module includes two group types in the implementation of hook_default_group_type as can be seen in here: https://pastebin.com/...
0
votes
1answer
32 views

Custom formatter for paragraphs field

I want to build a custom formatter for a paragraphs field that renders some of the fields of the paragraph. However, I don't know how to access the single files of the paragraph field. So far I've ...
0
votes
0answers
6 views

Group of multiple fields + Language Based Setup Architecture

I have two different languages in the site, one is english another is finnish. Need an interface in the node add/edit like below, where user will able to add different set of items for each language. ...
-2
votes
0answers
19 views

Send JSON with hook_menu and sent to method POST to URL [on hold]

I have written the following code: /** * Implements hook_menu(). */ function [NAME_MOD]_menu() { $items = array(); $items['test/json'] = array( 'page callback' => 'test_json_logs', '...
1
vote
1answer
206 views

Why does loadMultiple load 1000 nodes 5.5 times faster than loading each single node one by one?

I have always known that loading multiple nodes at the same time is faster than loading a single node many times. What I wasn't aware of, is the huge performance difference between the two ways of ...
1
vote
2answers
33 views

How to make PHPUnit test in a Module?

I'm not very much knowledgeable about making PHPUnit and Drupal testing setup. I am having problems regarding database calls. I tried to setup phpunit test. Inside my module/some_module. I ...
-2
votes
0answers
34 views

How to create a custom token for the Message module? [on hold]

I have a site with Drupal, as well as the modules "Message" and "Token". I created a custom module based on the module "Message example". I created for entities, a display mode called ...
0
votes
0answers
14 views

Implementing a contextual filter in a view with nested taxonomies?

We have a menu with submenus, for example: MenuItem1 Sub1A Sub1B Sub1C MenuItem2 Sub2A Sub3B Sub2C MenuItem3 Sub3A Sub3B When you click on MenuItem1, we want the view to display the ...
0
votes
0answers
25 views

Is it possible to execute a function on a user object in Twig?

You can use hook_entity_load to add fields to the user object like so: function mymodule_entity_load($entities, $type) { if ($type == 'user' ) { foreach($entities as $e) { $e-...
-1
votes
0answers
17 views

website does not display well on browser or computer [on hold]

I currently work on a development website. After transferring the website from development to product website, some images do not show on web browsers like Firefox, Opera, except Chrome in my computer....
0
votes
0answers
10 views

Webform Submission - Taxonomy Term ID Token

I have a webform that uses taxonomy term fields. After form submission I'm redirecting to a custom URL with query string parameters and using tokens for the values. The page I'm redirecting to ...
0
votes
0answers
13 views

Page relative to a node [on hold]

I have a working php script which takes a few arguments and prints a result based on the arguments. I also have a drupal website with a lot of content. Every node contains the abovementioned arguments ...
-1
votes
0answers
11 views

Determine what OS that the website is running on at any given time [on hold]

I have a situation where we are attempting to use flag emojis to represent different countries in some text fields. However, we have an issue with this when the drupal site is accessed from a Windows ...
0
votes
0answers
25 views

Tell the site to ignore the file path

I have a d7 site with static files under the docroot. (www.example.com/top-directory/sub-directory/file.php) I want all of the pages to follow the '/top-directory/sub-directory' URL pattern, ...
-1
votes
0answers
26 views

Finding a page to edit? [on hold]

I found a page on my site through a Google search. I can not find it in admin. I looked in the page's code and there is no node number for the page. In /admin/content/node I have looked at the pages ...
0
votes
0answers
10 views

Allow Order Item Type field to display on some products, but hidden on others?

I have two types of products on my website: Shippable Products and Non-Shippable Products. I have several Shipping Products set up. One of those Shippable Products needs a custom field to collect a ...
0
votes
0answers
12 views

Webform as checkout pane

We want to put a webform in a Commerce checkout pane. Webform allows to return a render array, as described in How to embed a Webform? $output['your_form_id'] = [ '#type' => 'webform', '#...
0
votes
1answer
28 views

How to add multiple “submit” buttons in Webform

If I add a button to a webform creating a module with something like this in it: $form['actions']['submit_2'] = array( '#type' => 'submit', '#value' => t('Submit 2'), ); It appears in my ...
0
votes
0answers
16 views

How to specifically define name and value attributes for checkboxes form element?

I am trying to build a form parallel to an existing 3rd party html newsletter form (from CleverReach). The final checkbox markup needs to look like this: <input name="1130400[]" value="lorem ipsum"...
0
votes
1answer
22 views

Select all nodes, where date is greater then current date and repeat event option is empty

I have content type "event". In this content type I have a date field, provided by the Date Recur module. At the result I have range of the dates: Event start and end date. Also Date Recur provides an ...
2
votes
3answers
49 views

Get node ID or URL in Twig on field level

I have a field value, which I would like to link to the content (to the node itself, using it in a teaser). How can I get the URL or at least the ID on field level, to create that link?
-2
votes
0answers
21 views

XSS problem and mod-security [on hold]

ive been got , i think . my hostings' mod-security has identified a problem> its all seemingly been fine so far for a couple of years Pattern match "(?:\b(?:(?:type\b\W?\b(?:text\b\W?\b(?:j(?:...
0
votes
1answer
16 views

Get title of referenced item two levels deep with Search API

I have three content types: A, B and C. A refers to B and B refers to C Now with use of the search api module I search my content types and I want to only output C. But in the result I want to show ...
0
votes
0answers
25 views

How to display fields in random order in a view

Hi I have a view that display mcqs (multiple choice questions). I want them in random order. I successfully sort the questions (one question in each node. I create a custom content type) randomly ...
0
votes
0answers
13 views

How can I list the previous published revisions of a node?

I have workbench moderation and revisions enabled on my content type. How can I list all previous published revisions of a node in views? I have created a node with revision 1 and published Then I ...
0
votes
0answers
19 views

Why all emails are rerouted to one email address?

All emails are sent to Email_1(for exmaple only). Even when I try to use different email(for example Email_2) and execute "Send test email" in mysite/admin/config/system/smtp, the Email_1 receives ...
0
votes
0answers
17 views

Drush locale-update doesn't update locale [on hold]

I pushed an update to our live system and forgot to do composer install before running drush locale-update. Now, for whatever reason, it refuses to do anything when I re-run drush locale-update. It ...
0
votes
0answers
8 views

Warning: Attempt to modify property of non-object [on hold]

I have created a custom module for updating webform field data, but I am getting the error Warning: Attempt to modify property of non-object in gievances_webform_submission_presave() I am using ...
1
vote
1answer
26 views

How can I load a Store by user ID?

I am building a multi-seller commerce site, where a user can register and sell their product. I need to display a menu link if the user is anonymous to "become a seller", where they are directed to ...
0
votes
0answers
11 views

How do I include data from the order item type fields in the order receipt email?

I have created an "Event Registration" product type and order item type. In the order item type, I added fields for the registrant's name and job title. How can I print the submitted values for those ...
0
votes
1answer
18 views

Custom Views style plugin and template preprocessor

I have created a custom views style plugin and with a template preprocessor for a custom entity. The template preprocessor will render a list of items with no contents in the row. The Views format is ...
0
votes
0answers
3 views

Unable to install site when attempting to upload a Background Process module

We recently added a new module Background Process to our local drupal environment by running the command drush en background_process -y. After installing, I was able to use the method ...
2
votes
0answers
22 views

How do I access data nested within JSON in a Guzzle service description response model?

I'm trying to pull some data into Drupal from a service, via Guzzle. I've got several clients like this working, but the data returned by this service is structured a bit differently: { pager: [ ], ...
1
vote
1answer
33 views

Set parameter for internal or external traffic based on IP

We want to block external traffic in Google Tag Manager and I am trying to do something like shown here. I created this: /** * Implements hook_init(). */ function myfunction_init() { $...
-3
votes
1answer
27 views

Where can I add content? [on hold]

I have a customer with an old website that is using Drupal 6.22 The "Locations and Directions" page is currently set up where you enter the date for each location and they appear accordingly. What I'...
0
votes
1answer
33 views
+50

wrong translation in admin/structure/views

I have a multi language site with Drupal 8.7.4 and default language is English. when i go to en/admin/structure/views i see list of views in English language. if i go to french interface via fr/admin/...
-1
votes
0answers
15 views

Need help with error message [on hold]

I’m new to drupal -- I'm trying to edit something on our home page but I’m getting an error message: "The specified passwords do not match. Please provide valid YouTube URL." It’s only happening on ...
1
vote
0answers
23 views

Define a default image when using image as base field in custom entity

I defined a custom entity type with an image base field. Now I want to have a default image which seems to be quite tricky: when I define a default image on a field api field and export the configs I ...

15 30 50 per page