Drupal 8 is the version of Drupal currently in development which will be the next major release. Avoid using it as the only tag, unless your question is only specific to this version, and does not involve non-core features, or core features that already have their tags.

learn more… | top users | synonyms (1)

0
votes
2answers
20 views

Entity view displays are throwing dependency errors during installation

I have a custom entity in my module. During installation I am creating a bundle for this entity. Then in the config I have two entity view displays for this bundle. One of those displays is for the ...
0
votes
2answers
21 views

Does Drupal even write any server configuration file outsite its directory?

I am trying to install Drupal 8 in a subdirectory of my server (it's a shared host) which runs on Apache 2.4.12 with PHP 5.5.27 (memory limit: 128 MB) and MySQL 5.6.23; I made them install the ...
1
vote
1answer
22 views

How get the default user picture?

For get the url of the picture : $user=\Drupal\user\Entity\User::load(\Drupal::currentUser()->id()); $picture=$user->get('user_picture')->entity->url(); But if user don't upload a ...
1
vote
0answers
32 views

Paragraphs Module alter form field

Using the Paragraphs module in Drupal 8, I am attempting to alter the behaviour of the form fields contained within the paragraph field. This is so I can add behaviour like ajax callbacks, hide show ...
1
vote
1answer
36 views

field_info_field() deprecated, what's the equivalent?

In Drupal 8 field_info_field() has been deprecated. The docs say to use this instead: Field::fieldInfo()->getField($field_name) I've tried various iterations of it, such as: $foo = ...
0
votes
1answer
13 views

drupal 8-b12: how to assign variables from FormatterBase-Interface to _page_attachments hook?

I have created new field-types in drupal. Therefore I have an Instance of FormatterBase, which gets the values from the database and tries to render the values. but i want to pass the variables ...
0
votes
0answers
20 views

How to save nodes using Drupal::lock() or db_transaction()? [on hold]

I'm wondering if you can save nodes programmatically using a notify endpoint. The idea is that a remote server will hit an endpoint on my Drupal website, and trigger changes to nodes. It's working ...
0
votes
2answers
22 views

How to install drush 8 properly?

I'm trying to install drush 8 via composer: composer global require drush/drush:dev-master (source) but it gives me drush version 7.0.0 which is without D8 integration... I'm using Linux Mint 17.
0
votes
1answer
26 views

drupal 8-b12: how to assign variables from BlockBase-Instance to twig-template

I want to create a Block-Module for drupal 8 (beta 12). To display the Content I want to use a twig-template (mytest-block.html.twig). But the Twig-Template needs some Data to Display, So I need a ...
1
vote
0answers
41 views

Getting a 403 error in REST

So I'm giving REST a try. Installed drupal-8.0.0-beta12 in a VM. cURL works fine using curl http://testing.dev/drupal8/node/1?_format=json but I'm not sure why I'm getting a 403 error message using ...
0
votes
1answer
21 views

How do I add a Javascript library to a field formatter?

I'm trying to include a Javascript gallery (jQuery lightGallery) on my new Drupal 8 site and wrote a field formatter for this purpose. Now I need to add the jQuery lightGallery to pages using this ...
0
votes
0answers
30 views

How custom a form for Bootstrap elements

I make a form programmatically, and I am looking how a web designer can change render. public function buildForm(array $form, FormStateInterface $form_state) { $form['metier'] = array( ...
0
votes
2answers
26 views

Unable to submit form to database in custom module

I am building a custom module and I'm unable to get the form to talk to the database. The section for uploading to the file system works fine. This is MyModuleBlock.php <?php namespace ...
0
votes
0answers
48 views
+50

Drupal8 views broken handler with custom entity type

I'm building a Bet website a long test of Drupal 8. Thanks to drupal console I managed to create a lot of custom entity types. Now I want to expose my entity to views but I get this message; One ...
0
votes
0answers
9 views

Quick search view submitting to full search view?

I've got a filter view in Drupal 8 that allows me to filter a specific content type by various taxonomies, dates and titles. I also need a 'quick search' view in the header which has the same ...
0
votes
1answer
18 views

How to set up a view containing a list of events ordered by date

I want to have a list of Events on the front-end like this: Upcoming (Newest on top) <Event1 title> @ <Event 1 Date> <Event2 title> @ <Event 2 Date> . . Past (in reversed ...
0
votes
2answers
31 views

Full vs Default mode

The FieldUI uses the default as default value for entity form/view displays. But the EntityViewBuilderInterface uses the full as default value. Also template_preprocess_taxonomy_term() uses the full ...
0
votes
1answer
41 views

Slow AjaxResponse for node content

I am using Drupal 8 so there is very little documentation or benchmarks, but I believe a route I have set up for ajax responses is not as performant as it could be. This is the route: next_node.ajax: ...
4
votes
3answers
150 views

How to redirect user to login form from 403?

I want to redirect anonymous user to log in if he encounters 403. I have created event subscriber and this is my code, but I end up on loop on the current page. /** * Redirect anonymous user to ...
4
votes
1answer
93 views

Is there any alternative to devel themer?

I am using Theme developer module for theming. The module is pretty good, but still it is very buggy. Is there a less buggy alternative?
0
votes
1answer
21 views

How to make view mode available only to selected bundle?

I have three taxonomy vocabularies which means that I have three bundles of the vocabulary entity type. I have a few view modes for them and one of them has to be available only to one of those ...
1
vote
1answer
37 views

Controlling node's content using field setting

In a module I am developing I wish to control display of a link in node's content depending on user's choice. I want to display this option to user(whether he wants to display the link on particular ...
0
votes
2answers
32 views

Drupal 8 How to add javascript to page

I have a Drupal 8.00-beta11 site and am trying to dynamically add JS to a page, so that I don't have to clear the cache every time I edit the JS file. I have a custom module (lets call it my_module) ...
1
vote
1answer
19 views

How to prevent installation to run from UI?

I have an installation profile that will be installed purely via Drush/CLI. So I need to prevent anyone to run the installation from web interface. What would be the best approach?
0
votes
0answers
28 views

Posted nodes with translations lose title

I'm currently prototyping a project in Drupal 8. I'm posting HAL json to /entity/node with the relevant headers to create nodes. I'm including translations as per this example: { "_links":{ ...
-2
votes
1answer
35 views

How make a template for designer for user registration?

I am looking for a "user-register-form.html.twig" for custom position of field in the page with twig. This is what i would like for the designer : <div class="row"> <div ...
0
votes
1answer
16 views

Drupal 8 Custom Entities from a UI?

Does anyone know away to create custom entities from Drupal 8 UI that is not ECK? I try it out using ECK and still a little bit buggy.
1
vote
1answer
22 views

How can I encapsulate Drush command with option to use arguments

I have a drush command for installing a Drupal website with configuration in it. I do not want to type this command with all the configuration all the time because it is long so I would like to ...
3
votes
2answers
66 views

Where should I store 3rd Party external js libraries?

This is a follow up to Define JavaScript library in Drupal 8 I have a third party library that I don't want to bundle with a module. In Drupal 7 I could just ask the user to extract to ...
3
votes
2answers
99 views

How do I add typekit fonts to a D8 theme?

Having looked over the existing D8 documentation on adding JS to the <head> of a page, I'm still not sure how to go about it? What is the correct way to achieve this on every page for my theme: ...
1
vote
0answers
38 views

How can I convert Twig to HTML? [duplicate]

I created a module to generate and display demo content; I would like to know if I can use Twig inside my pricing-table.html file and use a function to convert all data to HTML to use for #markup. ...
2
votes
2answers
117 views

How do I embed a form in a controller response?

I have a controller that returns a normal renderable page array. I'd like to embed a form in that page, but the form is not appearing in the rendered output. The form is properly added to the ...
0
votes
0answers
33 views

REST export doesn't give image URLs

We have a headless Drupal 7 project that uses express and handlebars for it's front end. I'm experimenting with updating the backend to use Drupal 8. I've created a REST export type view, but when ...
0
votes
2answers
43 views

How to check if library is present in vendor folder?

I have a form in which I am providing some options to users. But I want the options to appear in the form on the basis of presence of 3rd party libraries in vendor directory. I want something like ...
1
vote
0answers
21 views

Where can I view different form modes?

I created a simple content type and a form mode for this content type. Where can I view this form mode after creating it? I see no option for form modes when creating a content type. I would have ...
0
votes
0answers
15 views

Unit testing on windows

I hope this question is not very naive, the problem is that in Drupal 8 there are several unit tests written for modules and I want to test them. But since I am on windows os I am not able to figure ...
0
votes
0answers
27 views

Entity reference as select list in exposed filters

Drupal 7 had a nice Render Views filters as select option - is something like this possible in D8? I can't see how. Maybe someone could point me in the right direction for a coded solution if not?
-2
votes
1answer
57 views

Content Type and Fields programmatically

I make a module in Drupal 8 who create a new content type programmatically. Module name : Annonce In config/install I add this file: node.type.annonce_type.yml type: annonce_type name: 'Ajouter une ...
2
votes
1answer
28 views

How do I update the configuration of a module?

I'm building a custom module in Drupal 8. It includes some YAML config files. As I develop I need to change and add to the config, e.g. to add another field onto my custom entity. At present the ...
1
vote
2answers
20 views

Dynamically add options for widget

I'm developing a field widget for Drupal 8, similar to 'select' but with more functionality. Since the number of options is large and should be determined after querying an external API I was planning ...
1
vote
0answers
23 views

How to remove a configuration object from active config in Drupal 8

I'm writing a custom module for Drupal 8. It defines a field storage config object, in a file called modules/mymod/config/install/field.storage.bloom_stem.bs_twitter_ac.yml. The problem is that this ...
1
vote
2answers
38 views

Cannot use Drush in Drupal 8 [closed]

OSX Yosemite Drupal 8 beta 3. Drush version: 7.0-dev It works great with Drupal 7, but with Drupal 8: $ drush status opendir(//dev/fd/6): failed to open dir: Not a directory [warning] ...
2
votes
0answers
28 views

How to add custom field in form in drupal 8 [closed]

I have created content type in Drupal 8 and I want to add custom field in my form. Any suggestions about how to do so?
1
vote
1answer
24 views

Get all fields for a content type using REST

Is there any way to get all fields attached to an entity in D8 (including widget types), using REST services? I've tried the following endpoints, but none of them had the list of fields: ...
0
votes
0answers
54 views

Unable to install modules with Drush

I've got a fresh install of the Drupal 8 Beta 12. I'm trying to install the REST UI module: $ drush dl restui-8.x-1.x-dev PHP Fatal error: Class 'Drupal\Core\Session\AccountInterface' not found in ...
0
votes
0answers
34 views

How do I render the primary menu's markup?

I have {{ page.primary_menu }} in page--front.html.twig and I have the following in the .info.yml file of the theme. regions: header: Header primary_menu: 'Primary menu' content: Content ...
0
votes
1answer
41 views

Drupal 8 - url rewrite don't work on beta12 after installation

I don't have this problem on Drupal Beta 11, but with Beta 12, after installation, urls don't work, example : The requested URL /Beta12/admin/structure was not found on this server. Why I have this ...
1
vote
0answers
54 views

Multiple level of tab in Drupal 8

I want to have tabs but since they need to be dynamic I am making use of local tasks. In the class extending DeriverBase I have written the following function: public function ...
1
vote
1answer
47 views

Problem installing Drupal 8 in local “The translation server is offline”

I'm trying to install Drupal 8 on my laptop (localhost wamp server), and I allways get the folloging error in the first steps: Requirements problem The translation server is offline. The ...
0
votes
0answers
54 views

How do I write a Drupal 8 modal button

So I'm trying to open a modal via a button in Drupal 8 beta 11. I've patterned my code after some I found in BlockListBuilder.php in core, but I can't seem to get it to work. My routes are correct ...