Questions tagged [8]

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
1
vote
2answers
33 views

How to unpublish nodes which are missing in migration source?

I have a CSV file with two rows. I executed the migration and two nodes are imported. Now I deleted one row from the CSV and execute the migration again. I now want to unpublish the node which is ...
0
votes
0answers
29 views

How do I set cURL options in a custom migration?

I have a custom migration that needs to get JSON data from a remote URL. This works fine in a beta environment outside of ddev, but I'm having trouble in a ddev test environment because of SSL on the ...
0
votes
0answers
14 views

How to select the user desired crop in the “Manage Display” section of a paragraph type for an image field?

I'm currently using ImageWidget crop to give some aspect ratios for users to pick when editing content (1:1, 1:2, 2:1, 2:3, 16:9), that is properly set up in the "Manage Form Display" ...
0
votes
1answer
21 views

How can I render form elements?

In Drupal 6, I am using the following code. $rows[] = array( array('data' => drupal_render($form['collected'])), array( 'data'=> drupal_render($form['count']) . drupal_render($form['...
0
votes
0answers
13 views

LOAD DATA LOCAL INFILE suddenly stop working [duplicate]

I have created a script that insert record from csv to data but it suddenly stop working on and I am getting error : General error: 2 File '/code/sites/default/files/data_file/CSVFile.csv' not found (...
0
votes
1answer
25 views

VBO hook_entity_update

I would like to perform the following mass action via VBO: send a mail to author of a node. This mail is configured and sent in a hook_entity_update function. The beginning of the function is the ...
0
votes
1answer
45 views

Is there anyway create relationship for filter criteria which has vocabularies( state, city and location)?

list of available Vocabularies in my content type. Country(Term: US) State (Terms: CA , CO, DE.. etc) City (Terms:Fremont, Irwin, Los Angeles, Monument etc..) Location(Terms: All loacations) I'm ...
0
votes
1answer
25 views

Override specific configuration keys in settings.local.php

I'm trying to learn the Drupal 8 configuration override system based on the documentation here: https://www.drupal.org/docs/drupal-apis/configuration-api/configuration-override-system As a simple test,...
0
votes
1answer
53 views

Multiple forms on one page

I try to input several forms into one page via Controller. With code which is under, I see those forms but after submit one of them, nothing happens. Any of data is send to database. Has anyone idea ...
0
votes
0answers
13 views

Using simplenews in conjunction with sendgrid is possible?

I have installed and configured the simplenews and sengrid module. Sendgrid depends on mailsystem. When the module is installed, it configures itself. I've done the test posts that sendgrid provides ...
0
votes
1answer
57 views

Custom normalizer throws error once enabled

I wrote a custom normalizer last year to alter link output (using https://www.mediacurrent.com/blog/using-normalizers-alter-rest-json-structure-drupal-8/ as reference) for use with JSON:API output, ...
0
votes
1answer
62 views

How to automatically add http prefix to links in a form?

I am trying to come up with a solution to fix the D8 Link module to allow URLs like example.com (the most common use case, imho). I was thinking it would be simple enough to modify the submit value ...
0
votes
0answers
18 views

Making unique nid-based identifiers for titles using Bootstrap collapse fields

I created a view where I'm displaying only one content type, with four titles from content pages, one subtitle, and the content ID (nid) included in the fields for my view. I hid all these fields, and ...
0
votes
1answer
37 views

How can I invalidate cached field access grants for anonymous users?

We have a Drupal 8 application that uses an event subscriber class to validate IP addresses against a table of white-listed addresses on kernel requests, and adds that value to a session variable. ...
0
votes
1answer
21 views

How to do a Library Override in my theme for dialog.ajax.js

I’m trying to do a libraries-override to the dialog.ajax.js file appearing in /core/misc/dialog/. (Want to replace it with a js file from my theme, let's say at mytheme/js/dialog.ajax.js) In my theme’...
1
vote
1answer
37 views

Display status message after submitting modal popup form

Ok so i have a custom entity and want to display a custom delete form. Have created the Route and everything works except for Drupal messenger displaying status message after submission, even after a ...
2
votes
0answers
33 views

How can I access nested data?

Im currently using Drupal's http client manager module to pull data from a json endpoint. I am having trouble getting this to work for a nested structure like this. { count: 2431 page_info: [] ...
0
votes
1answer
45 views

How can I insert fields from custom content to custom form?

I have a problem with form. I had to create a custom content with fields. User can put variables into those fields and save to database, for example "Anna" into column field_student_name in ...
0
votes
2answers
87 views

Unable to install Pathauto, pathauto.settings already exists in active configuration

After upgrade from 8.7.10 to 8.9.13, i updated the pathauto module from ftp and trying to install from drupal admin but it showing an error like "Unable to install Pathauto, pathauto.settings ...
0
votes
0answers
34 views

How to redirect logged in user to different page rather than what is configured in basic site setting? [duplicate]

I have the following requirement: When an anonymous user visits the site, they will get /login page which is configured in Configuration -> Basic site setting -> Front page. After logging in ...
0
votes
0answers
25 views

How to prevent image/file deletion from a configForm if don't press on submit button?

I created a custom config Form in drupal 8, and this form have a managed_file field for upload a logo, the problem is that i set all fields, upload my image and fill other fields, press save, and in ...
1
vote
0answers
13 views

Prevent access from files with direct url

In the Group module people can upload files if they're group manager. But the thing is, these files should be restricted to the group and everyone who isn't a member may not see this files. The ...
0
votes
0answers
24 views

Unable to run drush via php's `exec` command

I'm creating an admin page for my module that will allow an admin to trigger scripts from within the module configurations. So far, I've created these routes: my_module.scripts.home: path: "/...
0
votes
2answers
68 views

How to create template suggestion for image like IMAGE--BLOCK-TYPE or IMAGE--FIELD-TYPE

I'm struggling to make template suggestions like IMAGE--BLOCK-TYPE or IMAGE--FIELD-TYPE. I have three different block types(image1, image2, image3) with one image field(field_image_1, field_image_2 ...
0
votes
0answers
14 views

Adding a button to a table form

I am trying to create a configuration page for my module that lists a set of php scripts that admins can use to trigger off different scripts. To do this, the configuration page is a form that has a ...
-1
votes
1answer
14 views

Creating a Select List + Textfield

I'm trying to create a supplies field made up of a select list (or entity reference) and a number field. Users should be able to create several of these. For example, the link field has a URL and ...
0
votes
0answers
31 views

How do I call php functions with parameters from Js in Drupal 8?

I am attempting to create/read nodes from a JS file (the nodes are created in response to Js events from a library). The PHP functions to create/read the nodes have been created and require field data ...
0
votes
0answers
11 views

How to set view header

I'm trying to hook into a view header for custom output but cannot get anything to output: function MYTHEME_views_pre_view(&$view, $display_id, array &$args) { if ($view->id() == '...
0
votes
0answers
18 views

Webform and MS SQL (D8)

I am assisting on a D8 site being developed and need to come up to speed as my only experience with Drupal is D6. The D6 site has a custom module/form that queries MSSQL data. It's a relatively simple ...
0
votes
0answers
16 views

Dump raw select query with parameters values

I would like to debug select query and I use the next code, for example: $connection = \Drupal::service('database'); $query = $connection->select('node', 'node'); $query->fields('node', ['nid']) ...
1
vote
0answers
17 views

systemAdminMenuBlockPage callback not respecting menu link permissions

I added a custom permission on "admin/commerce/config" to disable access for certain user roles. class RouteSubscriber extends RouteSubscriberBase { /** * {@inheritdoc} */ public ...
0
votes
0answers
19 views

How to build a workflow with content type tasks using Maestro

We are currently trying to build a workflowsystem using the Maestro module. Let's assume this: User A edits Task 1, enters a installation wish date User B edits following Task 2, sees (readonly) the ...
0
votes
0answers
39 views

Custom element doesn't appear in the UI

On my Drupal 8 dev instance (Acquia, PHP 7.315, Windows 10) I have the WebForm module installed. I want to add a custom element, like modules\webform\modules\webform_example_element. I have ...
0
votes
0answers
25 views

How to display scheduler module fields?

I'm trying to display values of the scheduler module fields publish_on and unpublish_on. Does anybody know where to find them? I cannot find them in /admin/structure/types/manage/article/fields. I was ...
0
votes
0answers
28 views

How do I correctly programmatically add the wizard behavior to a custom form?

When exporting a wizard webform the generated code seems not convert correctly wizard steps. They are displayed as "details" instead of wizard pages. Checking on the webform module it seems ...
0
votes
1answer
35 views

How can I have default field values for the node add form as arguments in the URL?

I have a path in drupal 6, which allow me to add new content with 2 fields completed. For example, path node/add/my_content_type/4/6 means that I am on page /node/add/my_content_type, and first field ...
0
votes
1answer
40 views

How can I reference an entity field in a template file?

I am trying to theme the node add/edit form for a custom content type (for example, Album). I implemented hook_form_alter() in the theme. function mytheme_form_alter(&$form, \Drupal\Core\Form\...
1
vote
0answers
22 views

Problems with file migration

I'm in the process of migrating a fairly large old site that has been migrated from Drupal 6 to Drupal 7, and now to Drupal 8. There are a few issues about getting this done, but I have a grip on most ...
0
votes
1answer
61 views

Attempting to merge in an array of items into Twig classes

I have a Twig template where I'd like to merge in an array of items as classes. So far I have this code: {% set classes = [ 'media', 'media--type-' ~ media.bundle()|clean_class, not media....
0
votes
0answers
24 views

How to connect different node bundles in one page

I am building a web site about football teams in Drupal 8 and I have the following content types Team, Player, Manager, Game etc. I would like to connect nodes from Player, Manager content types in ...
1
vote
1answer
45 views

How do I set a condition to only show a block to members of a group?

I use the Drupal Group module. Is there a way to check if a logged-in user is an groupmember or not when the user visits the grouppage? I have some blocks that should be hidden if an user is not a ...
2
votes
1answer
75 views

When “drush updatedb” is executed, are scripts cached by OPCache invalidated?

For sites that have PHP OPCache enabled: Does updating site using Drush require restarting the webserver to invalidate the scripts cached by OPCache? Does Drupal core or Drush invalidate OPCache ...
0
votes
0answers
13 views

Custom entity field UI “EntityDisplay entities can only handle fieldable entity types.”

I've created custom entity using drupal console and added my required properties using base field definitions. Everything was working well in that I could add and view the entities until I changed a ...
0
votes
0answers
15 views

Firing custom submit on ajax form works with #ajax_processed set, but reloads the page

I'm placing a subform within the node edit form using a form_alter where I build the subform and add it to the form array. My subform has a custom submit handler and '#ajax' is set: $form['...
0
votes
0answers
18 views

How to make custom views exposed filter work with AJAX

I don't know how to make my custom exposed filter work with AJAX: I have a view that has a contextual filter that filters for Node creation date by year. This filter gets filled via a query parameter ...
0
votes
0answers
24 views

FormState object gets no values from embedded form placed with AJAX

I have a form which is added to a node edit form via AJAX; a controller builds it, renders it, and sends it back to the node edit with the following code. $rendered = \Drupal::service('renderer')->...
0
votes
1answer
29 views

How to get the row added by ajax in the right place?

I have a table form created from a custom entity: public function buildForm(array $form, FormStateInterface $form_state, $contract = NULL) { $form['subscriptions'] = [ '#type' =&...
1
vote
0answers
31 views

Configuration export via drush randomly change the value of labels\other content in multilanguage sites

I've a multilanguage site, with Italian set as default and English as secondary language. When exporting the configuration via drush - drush cex command - sometimes the labels of other kind of content ...
0
votes
0answers
16 views

View List with distinct term listing of multiple nodes

I have a map where multiple nodes are shown as marker (filtered by terms). Now I would like to add a caption (block) which explains the (filtered) marker. The map may contain several results with the ...
1
vote
1answer
66 views

Decoupled login: How do I get the session cookie via JavaScript?

In the Medium app, if you go to the settings tab, you can change some of the settings inside the app. But, if you try to change your email notification settings, it opens up a web browser inside the ...

1
3 4
5
6 7
313