Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [8]

Version tags should be used only for questions that apply to a version only, not to merely say what version a site is using.

2
votes
1answer
117 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
2k views

How to populate an autocomplete using a web service?

I want to populate a form field, an autocomplete widget, with values from an external REST web service without actually importing the data to my database first (on-the-fly). How do I do that? Is ...
5
votes
3answers
5k views

Problem installing REST Server module

When I attempt to enable the REST Server module, I get the following error message: A library is missing for rest_server to work (Currently using Missing library Please download spyc and create a ...
8
votes
2answers
5k views

How to force regeneration of Twig templates?

Twig generates classes for its templates. These classes are effectively caches by being written to disc. Generally speaking, one probably doesn't need to bother with the details of how the twig ...
1
vote
1answer
218 views

POST taxonomy item using Services module

I want to POST a new taxonomy item. I'm using Postman in Chrome to test, I'm logged in fine, and I'm posting RAW JSON: { "name": "building", "description": "", "vocabulary" : { "id" : 1, ...
0
votes
1answer
4k views

How to deal with SalesforceException: HTTP Method 'PATCH' not allowed [closed]

I've the the Salesforce module mapping in place integrated with Commerce module and I've the following SalesforceException when purchasing the order: SalesforceException: HTTP Method 'PATCH' not ...
1
vote
2answers
1k views

Services Entity REST Application - Update (via put) Field Collection Data

I am trying to figure out what the format and required parameters are for an update request to a field collection via the Services Module's REST API. I have installed the Services Entity API Module to ...
3
votes
1answer
779 views

Create Node contains Field collection with restws + services

I am trying to create a node with RESTFULL api using restws and services modules (latest versions) on Druapl 7 - openpublish destro. the node contains a Field collection (images field collection field)...
3
votes
1answer
654 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
8k 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 is,...
3
votes
2answers
2k views

Using drush on drupal 8?

Dursh works very well with my Drupal 7, but when I try running Drush on Drupal-8 directory it throws some error message, $drush pm-list Command pm-list needs a higher bootstrap level to run - you ...
5
votes
1answer
3k 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
39 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 ...
2
votes
1answer
155 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 ...
5
votes
4answers
2k views

Services 3: Setting taxonomy terms on node creation/update

For a custom node type, I have defined a field that is to hold an unlimited number of values from a taxonomy vocabulary that I defined. This is what it looks like: [field_taxonomy] => Array ( [...
1
vote
1answer
820 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) function(https://api.drupal.org/api/...
7
votes
1answer
1k 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 ...
6
votes
3answers
3k views

Drupal 8 devel dpm does not expand Drupal\node\Entity\Node

I'm getting a feeling that Devel got pretty much useless with D8. When I try to dump most of the drupal objects I get only (Object) Namespace\Class output. No fields data is printed. print_r is able ...
-1
votes
1answer
46 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 ...
2
votes
2answers
598 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 ...
1
vote
1answer
240 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
211 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. ...
3
votes
1answer
6k views

How to define an optional argument to Route callback

I want define a simple controller action, which receive optional argument: <?php namespace Drupal\hello\Controller; class SimpleCallback extends ControllerBase { public function sayHiAction($...
1
vote
1answer
476 views

Passing object in routing.yml

I have an entity and when I try to pass the whole entity object, only the name is passed through the routing. Here is the relevant code in routing.yml: mymodule.myentity_info: path: '/admin/config/...
1
vote
1answer
786 views

Checking if a machine_name exists or not

My EntityForm has a field where '#machine_name' => array( 'exists' => array($this, 'load'), To check the validation of this, I wanted to know about writing the function load() in my ...
-1
votes
1answer
117 views

EntityListBuilder only shows the last Entity that was added

I've build up an Entity for my module. The problem is that the EntityListBuilder doesn't show all the entities that I've added. Only the last entity that I added shows up. Here is the drupal sandbox ...
0
votes
1answer
1k views

Building EntityForm in Drupal 8

I'm continuously getting the error: Drupal\Core\Config\Schema\SchemaIncompleteException: Incomplete or missing schema for mymodule.myentity.myentityname in Drupal\Core\Config\Entity\ConfigEntityBase-&...
2
votes
2answers
304 views

Do Drupal 8 / backbone.js have conflict when using AngularJS on top?

I've just pulled D8 HEAD for my website and I want to use AngularJS instead of backbone.js to create a web app but realized D8 have already embedded backbone.js on every page. I can disable modules ...
0
votes
1answer
1k views

User created by REST API cannot login: wrong password

I am creating new users using Rest API provided by Services module. The user creation goes well, but when I try to login with the user I've just created it says wrong password. The website where I'm ...
0
votes
0answers
865 views

How do you edit the contextual links on a custom block in drupal 8?

Currently the only link that shows on the contextual links for custom blocks is the "configure block" link. I want to add an edit link to get to the main content of the block, is this possible?
1
vote
1answer
375 views

How to avoid caching of fields in Entity View?

I have a few computed fields on my entity and they have dynamic values. These values cannot be cached because they change often. I've created the necessary field formatter that uses the same approach ...
2
votes
1answer
1k views

Get the default value of a variable

I want to display the default value of a variable when no value is set. I checked the Drupal 8 documentation pages, but I couldn't find any information about the default value. In Drupal 7 if ...
0
votes
1answer
376 views

Can't get the authenticated user cookie session to be used when creating a new node via Services 3 endpoint

My application is sending this header to Service 3 endpoint when creating a new node: { 'Cookie': 'SESS255f42d9a87a0df5bf8959d25909fe8c=St8o29NI9Hx84kPo8NuZbpdHWuRgNSS9qy9cQ-QM4rA; expires=Sun, 15-...
0
votes
1answer
55 views

How can I use View modes for entity without bundles?

I have an entity that has no bundles(ie. it has itself as a - 1 - bundle) and I need to be able to use View modes for it. My understnading is that the Field UI needs the 'bundle of' entity to exist ...
1
vote
1answer
109 views

What's the data structure that needed by services for posting new node with drupal7 services?

I have content type named "shen" and gona to create new node with services module from crawl machine data. For now, it can login in system and post new node but it can't save image field data. this ...
1
vote
2answers
5k views

Drupal Rest services “access denied user anonymous”

I have created a custom service where I am passing parameters and retrieving result from another file. So to test it I tried on Postman and I put URL with sitename/endpoint/resource and passed ...
4
votes
0answers
61 views

How should the code structure of a distribution look like? [closed]

I'm making a distribution and so far it consists of only one module which holds the whole code. Since D8 is now fully OOP and has autoloader and other stuff I was wondering how should the structure ...
1
vote
1answer
272 views

How to use Views on custom route?

Views require "Use AJAX" in order to display exposed filters when using Block display. I think this is necessary to avoid submitting/influencing other form elements on the current page. I have a page ...
0
votes
1answer
338 views

How to hide blocks from administrator?

I need to hide some blocks from priviledged user so he won't be able to attach them to regions via the Block layout. What is the proper way of doing this?
0
votes
2answers
115 views

How to build route for entity without loading it?

I'm making a tree view of vocabulary terms and I need to link each term to it's page(depends on which link template name is provided as argument to my function). I'm loading the terms with ...
0
votes
1answer
309 views

How to get list of templates for the active theme?

I am creating UI that will allow users to edit the active theme's template files(something like Wordpress does). For this I need to get the list of all templates from the system and to know which ...
2
votes
3answers
304 views

How to install Drupal without interaction via web UI?

Is it possible to confgirue installation profile so it can be installed via web UI as usual but without any interaction, just the progress bar?
1
vote
1answer
305 views

How to keep your Drupal 8 site synced with 8.x branch

Is it practical to both A) develop/maintain a Drupal 8 alpha site and B) keep it up to date with the latest daily/hourly commits from the 8.x branch ? If so, what would be your strategy to keep your ...
1
vote
1answer
2k views

How to get all filters and functions available in Twig templates?

I have an option to create and edit twig templates via UI but I need to display what filters and functions are available to the user but I don't know how to get them.
6
votes
1answer
938 views

What is the convention for naming routes?

Lets say I have these paths: /admin /admin/settings /admin/settings/myentities myentity/id /admin/settings/myentities/id/edit /admin/settings/myentities/id/delete What would be the proper route ...
0
votes
1answer
2k views

How to use GROUP BY and SUM in Views table?

I have custom entity "product". It's base table is "product" and it's primary/id key is "entity_id". I have created all Views definitions for this entity. Additionally I have another table called "...
1
vote
1answer
293 views

What is the difference between $container->get('current_user') and global $user?

I've been looking at symfony's implementation of dependency injection, and it seems like a service locator pattern. It appears, at first blush, that the service container is not entirely different ...
4
votes
1answer
2k views

Define JavaScript library in Drupal 8

In Drupal 8 some javascript changes were introduced so now all js scripts should be defined using hook_library_info() and added to the page only with #attached attribute of the render array. But what ...
3
votes
2answers
489 views

Is Migrate module supposed to be used for imports too?

I am in need of an entity import functionality so I started to write my own. But then I started to think if I'm not reinventing the wheel and it occurred to me that maybe Migrate module will be used ...
1
vote
1answer
790 views

Integrate external DB users via their API in Drupal 7

I want to integrate an external API (REST) to login users which are on that external database using the drupal 7 login form on my site. I have the API specifications for Login, Registering, Getting ...