Drupal 8 is the version of Drupal currently in development which will be the next major release.

learn more… | top users | synonyms (1)

0
votes
0answers
10 views

Share config on Drupal 8

I have this error when I try to import the config of an another site: The staged configuration cannot be imported, because it originates from a different site than this site. You can only ...
0
votes
0answers
17 views

Can not remove the Devel module

While doing an upgrade to the Devel-module something went terrible wrong. Decided to remove the module through the "Uninstall"-tab. The module is however not listed there, while it's marked as active ...
0
votes
0answers
11 views

Adding a list of strings or entities to another entity

I need to be able to add a list of departments to an entity directly via the add form of that entity. Those departments don't necessarily exist in the application beforehand and could be strings or ...
3
votes
3answers
366 views

Drupal 8 vs 7 performance comparison?

I am wondering if there are any reliable performance comparisons between vanilla D8 vs D7? I have searched the web but only find this which is far from encouraging.
0
votes
1answer
35 views

Converting entity to JSON

I am quite new to Drupal and Drupal 8 so forgive me if my questions seems rather naive. I have created a custom module that creates a custom content type. I am attempting to extract those entities ...
0
votes
1answer
25 views

setting up drush AFTER drupal multisite installed

new to drupal and even newer to drush. godaddy shared hosting, I manually setup drupal 8.x multisite where one site is the host account and the rest are subdomains to it. (I didn't use the cpanel ...
0
votes
1answer
33 views

How send a mail with attachment on Drupal 8

I try with this, but no success: $params = [ 'body' => 'My body', 'subject' => 'My subject', ]; // I check by debug this code and $file get the right file $file = File::load($myfile_id); ...
3
votes
1answer
77 views

Get url for every language on Drupal 8

I have a route of a page, ex: contact.site_page. I want get the link for it on every language of my site. On my site the contact page is: for English: /en/contact for Spanish: /es/contactenos I ...
1
vote
1answer
31 views

Inline Entity Form in Drupal 8 (create item while adding a reference)

I have a Family content type and a Person content type. A Family has an entity reference to one or more Persons. The normal workflow requires me to first create the Persons, then create the Family ...
1
vote
0answers
33 views

Drupal 8 cron not running from external source (as anonymous)

Running cron with crontab is not working on our Drupal 8 website if the user is anonymous. If I'm logged in as admin, I can run cron with the button or the url with key. If I'm not logged in, cron ...
0
votes
2answers
40 views

How not render a region on specific page programmatically on Drupal 8

I put a custom block (develop for me) on sidebar first region for every page, every fine, but I want that this block not render on the home page. On my module, I made this: funtion ...
0
votes
1answer
24 views

Custom Entity Not Showing in View Creation UI

I started learning Drupal 8 this week. I followed this guide to create a new entity, which I then made available through REST using the following tutorial: ...
0
votes
1answer
37 views

Drupal 8 Migration fails without any error

I'm trying to run a migration D7 to D8 which I've coded. This is the command: drush migrate-manifest manifest.yml --legacy-db-url=mysql://DrupalAdminUser:drp800sk@localhost/drupal7ddbb --verbose ...
1
vote
1answer
48 views

How can I enter a custom maintenance mode message for a non-English D8 site?

I am playing around with a D8 site (8.0.0-beta6) and having trouble locating where some of the controls have gone. During the initial installation procedure I selected a non-English localization ...
1
vote
1answer
40 views

How can I disable a troublesome module in D8?

I've been playing around with D8 and have managed to break a few things I can't figure out how to fix. Most recently, after installing (via manually adding the module code to the modules folder) the ...
2
votes
2answers
41 views

How to skip route if not user access

I have two routes (from views module) with path "/test". Route N1 required "role_1" user role, route N2 required "role_2" user role. Rote N1: class Symfony\Component\Routing\Route#9524 (9) { ...
1
vote
1answer
27 views

hook_page_attachments() not called from mytheme.theme file

I am trying to load an asset library in my Drupal 8 custom theme. I have created the library and can load it via mytheme.info.yml file. However, if I try the load it using hook_page_attachments() in ...
1
vote
1answer
69 views

Why can't I reinstall my module after uninstall?

With last beta version of Drupal 8, I have this error: Error message Unable to install Nature Theme - Structure and configuration, block.block.kyna_block_aboutus, ...
1
vote
1answer
34 views

Modify Drupal pagination to restrict shown page numbers on Drupal 8

On Drupal 8: I have a pagination for list of articles within a Drupal site e.g.: <<first <previous ... 3 4 5 6 7 8 9 10 11 ... next> last>> So at the moment there are always ...
3
votes
1answer
62 views

Drupal 8: How to properly add a settings widget to a node add/edit form and save the value?

So I reviewed the code in the core book, menu_ui, and path modules, and they all seem to handle adding a settings widget in a vertical tab differently. The book module uses a method called ...
6
votes
1answer
72 views

Programmatically get a form in Drupal 8

The documentation states: The argument passed to the getForm() method is the name of the class that defines your form and is an implementation of \Drupal\Core\Form\FormBuilderInterface. How ...
0
votes
1answer
45 views

Image field, how add title field?

Here drupal have a field for set a description for each images: How I can add a custom field for each image please ? By example a "Title" or "Author" field ? Thanks.
0
votes
0answers
42 views

Use a collection of form inside a single form (as Symfony2)

I would like know if it's possible in Drupal 8 to have forms inside form. The perfect example is inside Symfony2, it's possible to use a field called Collection and return a FormType to have a ...
0
votes
1answer
22 views

Insert my files inside a custom table after upload?

How to insert my uploaded files inside a custom table (as managed_file) after upload inside a custom form on DRupal 8 please ? For moment, I have : $form['images']['new']['local'] = array( ...
1
vote
1answer
26 views

How to show contextual links buttons in templates with minimal markup?

I want to get rid of the most markup in Drupal 8 templates, but still want to have working contextual links. How to do this?
0
votes
1answer
28 views

View Mode not showing up under Manage Display

I created a view mode let's call as my_node_view for content type under display type settings, I was expecting it to show along with default and teaser tabs as default|teaser|my_node_view in manage ...
1
vote
1answer
44 views

How to render a contact form in a theme

I am looking for a way to display the side-wide contact form in a block (through my .theme file). Using this code won't work (as contact_form is not a content entity?): // get default form // get the ...
0
votes
1answer
27 views

Convert Media tags to markup

I imported the contents of a website from Drupal 7 to Drupal 8, but some nodes contain something like this: ...
0
votes
0answers
111 views

How do I configure the trusted host settings?

I have changed the Trusted Host Settings on my website where I currently installed Drupal beta 8.0 alpha version. But in the error report it is still saying that "Trusted Host Settings NOT ENABLED" . ...
1
vote
1answer
32 views

Why does default.settings.php suggest writing the value of the hash salt in an external file?

The default.settings.php file contains the following comment: For enhanced security, you may set this variable to the contents of a file outside your document root; you should also ensure that ...
0
votes
0answers
46 views

Send a form to twig template in Drupal 8

How I can pass a form to twig template in Drupal 8? For example, I get this: a form: mymodule/src/Form/MyForm.php Then on my Controller: public function myController() { ?????? return [ ...
1
vote
1answer
32 views

Save a format for a node body

How do I save the format used for a node body? I am using the following code, but it doesn't work. $article = Node::create(array('type' => 'article')); $article->setTitle($node->title); ...
0
votes
2answers
15 views

How remove/hide an action field link?

On a node field form (admin/structure/types/manage/article/fields), I have a dropdown with action links for all fields. Edit Storage Settings Delete I would like know if it's possible to unset the ...
0
votes
1answer
25 views

Base field provided by a module is not accessable

this is a follow up to my question here. In my .module file I use the following code to add a base field to all my nodes: /** * Implements hook_form_BASE_FORM_ID_alter() for node_form(). */ ...
0
votes
1answer
24 views

Access user fields in Drupal 8?

The following: $account = \Drupal::currentUser(); loads the user object into $account, but how do I access custom fields I've created on the user object (via the admin UI). After doing dpm() on ...
0
votes
0answers
18 views

How do I properly define the widget for a file field attached to an entity type? [duplicate]

I'm creating a custom entity type and trying to add a file field to it. Amongst other field definitions I have the following in baseFieldDefinitions(): $fields['file'] = ...
0
votes
1answer
36 views

Is it possible to use an Oracle database for Drupal 8?

We are evaluating Drupal 8, and one of our needs is to use Oracle as the main (and only) database. Is it possible to use Oracle as the Drupal 8 database? Can be a problem with the external modules? ...
0
votes
1answer
32 views

Is it possible to add node alias programatically to created node by code in drupal 8?

I have created pre save hook in module which is populating my node by fetching information from various API's. However I can't get my mind around how to add node alias to newly created node. Is there ...
0
votes
1answer
26 views

How to bring custom block theme suggestions into the right hierachy?

I have to create theme suggestions for my content block types (custom blocks - configured via admin/structure/block/block-content/types), because i didn't find them as default suggestions. The ...
1
vote
1answer
22 views

How to print and/or manipulate individual image attributes and suppress width and height via the image.html.twig template

I had to get rid of the width and height attributes in my images and wanted to learn better the possibilites of Twig in Drupal.
1
vote
1answer
39 views

How to create a redirection in Drupal 8?

How to create a redirection in Drupal 8 ? By example, with hook, and after login or if an url is called.
6
votes
3answers
216 views

How know if user is visitor or logged member?

How can I determine programatically whether the current user is anonymous or authenticated?
0
votes
1answer
15 views

Don't allow “Delete this field” if a module is activated

Inside "Article" type, I have a field called 'field_xenforo_thread_id' (machine name), It's possible to disable the "Delete" option only for this field and only if my module is activated please ? If ...
1
vote
1answer
92 views

How do I access a node object property, if it is an array, in Drupal 8?

$node = \Drupal\node\Entity\Node::load($nid); Having loaded a node object in Drupal 8, I know how to access a property, if it is a single value, and assign it to a variable, $test in the example ...
0
votes
1answer
27 views

Override submit function in Drupal 8

How can I override the submit function in Drupal 8? (alter the submit function) I tried adding this to my hook_form_alter: $form['#submit'][] = 'mymodule_form_submit'; but it doesn't goes into the ...
0
votes
2answers
29 views

Drupal 8 deregister migration

I'm playing with migrations from D7 to D8 and I've found that, when you register a module with a migration, if you disable it, next time you enable the module gets stuck on this: [vagrant@devbox] ...
1
vote
2answers
62 views

How know inside hook_entity_presave() if it's a create or update?

How know inside hook_entity_presave() if the entity is create or update please ? Thanks. Note: I want use presave and not update and insert hook.
0
votes
1answer
31 views

Block field to referene a view

I am struggling to find a way for a custom block type of mine to reference a view. Basically I want a field of the block to show some of the newest articles. Using the entity reference field and an ...
-1
votes
1answer
34 views

$node->toArray() don't work?

Here : How do I access a field value in a node object? Chx say : You can always do $entity->toArray() to see what's in an entity But $node->toArray(); don't work for me, why please ?
0
votes
1answer
22 views

Block error on CMI

I have two identical sites on Drupal 8 (A and B), on (A) I created a custom block(block/add), and then I export the configuration(drush config-export) and import this config on (B) (drush ...