Tagged Questions

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

learn more… | top users | synonyms

0
votes
1answer
15 views

Equivalent of file_transfer()?

I am porting a Drupal 7 module to Drupal 8; it has a call to file_transfer($uri, $headers). What's the equivalent Drupal 8 code for this?
-1
votes
0answers
22 views

how best store audio files using drupal 8 and export them using web service?

I would need advice on conception of a audio files database on drupal 8 available on a mobile client using web services. So far I have successfully created a RESTFUL export view containing json ...
0
votes
1answer
30 views

Why after installing Drupal 8 all links to the front page generates 404 error? [on hold]

After installing Drupal 8 I get access to the front page but all links generate a 404 error. Why clicking on any links gives 404 error: http://localhost/drupal8/ while everything works fine with: ...
-1
votes
0answers
26 views

Migrate from Drupal 7 to Drupal 8 (NOT 6) [duplicate]

I've read about migrating from Drupal 6 to Drupal 7 but I can't find information on how to migrate drupal 7 to drupal 8. The only things that I've seen is how to migrate a MODULE to Drupal 8. But ...
1
vote
2answers
23 views

Writing functional tests for a controller that makes call to external service?

I'm working on the D8 version of the CAS module. To integrate with a single sign on CAS server, this module will have to redirect the user to the CAS server often, and occasionally make cURL requests ...
2
votes
1answer
35 views

Web services for specific node

I know you can enable Web services for content in Drupal8. You also need to set permissions to make a GET request to content. But I was wondering if it's possible to set for each node if it can be ...
0
votes
1answer
23 views

How can enable multiple contact form in drupal 8?

I want multiple contact forms(different fields) in my drupal 8 site Like Webform module drupal 7. I have tried to add multiple contact forms and i am able to number of contact forms with different ...
-4
votes
1answer
65 views

Why Twig and not Blade in Drupal 8? [closed]

I was lately asked the question why Drupal 8 uses Twig as templating engine and not Blade, which is used in Laravel. I couldn't answer the question. But is there a specific reason why Drupal 8 uses ...
1
vote
1answer
81 views

How do you update a Drupal 8 site? [closed]

What is the proper procedure to update a Drupal 8 site from one release to another? Is the process the same as with Drupal 7 and earlier, or are there different/additional steps? When I tried to ...
4
votes
1answer
140 views

Trying to add an html head tag in Drupal 8, beta 2

With Drupal 8.0 beta2, drupal_add_html_head() has been deprecated in favor of #attached. So the old way was: function MYTHEME_page_build(&$page) { $viewport = array( '#type' => ...
1
vote
2answers
46 views

D8: How to perform ajax call in javascript

I'm trying to perform an ajax call from a javascfript file by executing this: $.ajax({ url: '/lunapark/ajax/space-invaders/' + score, success: function ...
2
votes
1answer
31 views

How do I get a hold of the session object in my form handler?

I have build a form in D8 and on submit I want to save the form values into a session, so that I can access them 3, 4,.... page requests later. In D7 I just used $_SESSION['key'] = $value I have a ...
1
vote
1answer
16 views

Drupal 8 and Session Management

I was wondering how to use sessions in D8... There must be a wrapper of some kind so that I don't have to use $_SESSION? I can't seem to find it. Can anyone point me in the right direction? Edit: ...
1
vote
0answers
13 views

Contextual filter on content ID returns 404 in drupal 8 beta 2 [closed]

I'm trying to show a list of all articles available but filter that list by URL argument if that's available. So basically: http://myhost.com/article_listing/ Should show all articles Works ...
0
votes
1answer
22 views

How to edit and delete drupal 8 custom block content?

I am not getting any option to edit my custom block body content and not able to delete also. Please suggest me. Thanks
0
votes
0answers
34 views

Can a Drupal 8 theme leverage block config Yaml files when enabled for the first time?

In my Drupal 8 contrib theme, when the theme is first enabled, a number of system blocks are dumped into the first region that's in my theme's info.yml file. From a UX perspective, this is not really ...
1
vote
1answer
88 views

Drupal 8: How to mimic route handling

In drupal 7 I have a chunk of code that gets the page content by mimicking what drupal does: $router_item = menu_get_item($href); if ($router_item['access']) { if ($router_item['include_file']) { ...
0
votes
1answer
36 views

Drupal 8 custom validate user register

I've created a module for Drupal8 that checks against values in the user register and set an error if the values do no match with something you have entered in a custom form. My module has got a form ...
2
votes
1answer
69 views

Overriding menu.html.twig just for the primary menu

Drupal 8 Beta 1 has a lot of nice templates to use which can be brought into a custom theme and then customized. I brought in core's menu.html.twig into my custom theme and indeed I can customize ...
-1
votes
1answer
27 views

Plain text comments in Drupal 8

In Drupal 8 comments, can I remove the subject field and only have a single plain text box? My goal is to set up something like a ticket tracking system. I will have a the Issue node. But I'd like to ...
0
votes
2answers
115 views

Getting error after install drupal8?

I have installed drupal 8 . During installation i am getting the below error Drupal requires you to enable the PHP extensions in the following list (see the <a ...
2
votes
1answer
38 views

How to attach browser-specific stylesheets in D8?

In D7 it's possible to attach a css file based on browser sniffing, like this: drupal_add_css( $path_to_css, array( 'browsers' => array( 'IE' => 'lte IE 9', '!IE' => ...
1
vote
1answer
33 views

Drupal 8 field API vs. $form_state

I am creating a field with Field API, and having it shown on user registration form. However, I need its value in order to make validation. For that purpose, I've used dpm($form_state) which gave me ...
3
votes
1answer
132 views

Log a user in manually, get session?

A service I have takes a username, and should find and log in a local Drupal user account with that username. After logging in, I need the session ID (from the sessions table) for that users new ...
6
votes
1answer
85 views

How do you Drush download Drupal 8 Alpha via the command line?

I usually download the latest drupal 7 using the command: "drush dl drupal --select" But drupal 8 isn't listed there. What are some nice and quick ways of download the latest version of Drupal 8 even ...
0
votes
0answers
47 views

Creating a custom FieldType (D8)

I'm trying to create a custom FieldType which provides the fields for a complete address (street, house_number, post_code and city). I created a FieldWidget, FieldFormatter and FieldType class and a ...
0
votes
1answer
23 views

Autoloading in Drupal 8 or How do I load an external class into the Controller? [duplicate]

I'm playing with module building in Drupal 8, but can't really figure out how to include a custom class which does not extend any other. The class' only purpose is to reduce the amount of code I have ...
1
vote
1answer
93 views

How to include custom class file in Drupal 8 module

In Drupal 7 module development, I could include a custom inc, api, or php class file using the file[]= directive in the module.info file or the drupal_load_included() function. With D8 using PSR, ...
0
votes
1answer
32 views

Is it possible to disable a node module?

Is it possible to disable a node module in Drupal 7? As I understand through interface it is not possible. Why node module is so important? What if I'm going to use only custom entities?
3
votes
1answer
53 views

Doctrine annotations for custom field formatters in Drupal 8

I am trying to port my Drupal 7 module, Views Hybrid, to Drupal 8. It provides a custom field formatter. In order to provide the field formatter, I am using the Doctrine annotation roughly following ...
0
votes
2answers
87 views

Consuming RESTful web services with Drupal 8

Is there any existing Drupal 8 module (on drupal.org, GitHub or anywhere else) that would leverage Guzzle to consume JSON and/or HAL+JSON Web Services over REST? Alternatively, is the recommended way ...
0
votes
2answers
53 views

Getting image SRC with xpath - Simpletest (WebTestBase) [closed]

I am developing a Drupal 8 test which will check for a image's existence. The image will not be loaded while running the test and I want to catch that using xpath(). The HTML I am trying to search ...
0
votes
2answers
48 views

Attach js file to every page w/term reference widget in Drupal 8

I have begun trying to port a small, simple module that I maintain to Drupal 8. It was originally written (not by me) in Drupal 6 and used hook_init() in combination with drupal_add_js() to attach ...
3
votes
3answers
145 views

how to load a third party php library for drupal 8

I have a third party php library which I would like to use in a module. How do I do that in Drupal 8? In drupal 7, I have done things like: require(libraries_get_path('twitter-api-php') . ...
1
vote
1answer
47 views

Drupal 8 Configuration API - cant access variables

I have made a simple example to practice using the configuration api in drupal 8. I created the following twitter_pull.credentials.yml file in the config/install folder: oauth_access_token: "12345" ...
0
votes
1answer
60 views

Drupal 8?! Why does Drupal download webpage recommend Drupal Core ver. 7.x? [closed]

Why does Drupal download webpage recommend Drupal Core ver. 7.x? I can hardly see footprint from Drupal version 8 in Drupal website direct links. Does it mean that Drupal 8 is still under ...
4
votes
1answer
154 views

How do the seasoned OO PHP people go about setting up a professional development environment and how can we apply this to Drupal 8

A few years ago I was in to Drupal 7 development. Back then, in the company I worked for, we just kept everything in the database, had a few modules we kept on disk somewhere, didn't really use ...
3
votes
1answer
187 views

Drupal 8 - “Implement menu links as plugins”, trying to build a menu tree

In a previous Drupal 8 menu question here, we determined that menu tree building was now a service. In my D8 contrib theme, I was then able to render the main menu tree as: function ...
0
votes
1answer
28 views

Default installation of D8 treatment of .gif accesses?

If I request a non-existent URL, say, /ddddd I get Page not found (as expected). If I do th4 same with an unusual extension /dddd.xcf I also get Page not found. BUT if I request /ddddd.gif there's an ...
1
vote
1answer
81 views

Correct way to use hook_menu_alter

What is the correct way of using hook_menu_later. I did this in my module to redirect (see also redirect in hook_init makes body text disappear): function MYMODULE_menu_alter(&$items) { ...
2
votes
1answer
51 views

Check for double escaped string - Simpletest

I am trying to create a test case against a patch which will be used for automated testing in D8 release. However, I am trying to do it to check if the page I am on it, has any multiple escaped HTML ...
0
votes
1answer
33 views

How to determine taxonomy vocabularies related to a specific content type in Drupal 8?

could anyone help me please, how to get the vocabularies to a given content type? For example in older Drupal cores there was a taxonomy_get_vocabuleries($type) ...
1
vote
2answers
360 views

Drush was not able to start (bootstrap) the Drupal database - MySQL Access denied error

I've installed Drush 7 using Composer and working with Drupal 8 and 7 on Ubuntu 12.04 with PHP 5.4.31, mysql 5.5.38 Drush will dl modules and themes just fine but when I want to en a module then it ...
5
votes
1answer
116 views

Understanding Drupal 8 and namespaces

I am new to namespaces and I am practicing with Drupal 8. I have created a custom module and have installed the contrib, devel. Inside my module, I have defined a block, here is my code: namespace ...
0
votes
1answer
25 views

Drupal 8 module - page errors out

I have a drupal 8 sandbox site where I have started a module. I am practicing with registering paths. on my /tweets page, it errors out and says "Drupal has encountered an error". What is wrong with ...
0
votes
2answers
104 views

How to receive JSON data in controller with Drupal 8?

I'm using AngularJS one of my module's settings page, so I have a javascript object in client side as a model. Could anyone help me please, how to catch this data in a controller if I send it as JSON ...
1
vote
1answer
40 views

Drupal 8 condition plugin, two on the same form?

I'm working on porting the CAS module to Drupal 8. On the main configuration form, users can list paths that will activate a feature of the module. I read about using the new condition API recently, ...
2
votes
2answers
138 views

How to pass an extra argument to an entity form?

Suppose, I've two entities: entityA entityB A user creates an entityA and has the option of creating multiple types of entityB referenced from a single entityA. For example, a parent-child ...
0
votes
1answer
38 views

How can I list all Twig functions and filters with their description?

I want a list of all available Twig filters and functions and for each one of them I need to have a description of the function/filter so the user can see what functions and filters are available and ...
0
votes
1answer
37 views

Making entities under another entitytype

Suppose, I've created -name -machine_name an entity_type myentity with its schema as: -name -machine_name Next, I want to create another entity subentity that will be grouped under myentity. ...