We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [8]

Version tag to tag issues specifically related to Drupal 8.x. Please note that version tags should be used only for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
0
votes
1answer
270 views

How can I implement a RESTful API in Drupal?

Can any one please let me know what modules are available to implement a REST API? So far I've only found the Redmine REST API module, which is used for Redmine.
6
votes
1answer
338 views

What is the difference between t() and @Translation()?

When writing a (translatable) plugin in Drupal 8, you have to use Drupal\Core\Annotation\Translation;, and then wrap your value in @Translation("value"), however when implementing the FormInterface, ...
5
votes
1answer
572 views

Is it possible to remove Route objects from a RouteCollection object?

When I look at the code used for the method handling a RoutingEvents::DYNAMIC event, which receives a RouteBuildEvent object, I notice the code is always similar to the following one. $collection = $...
4
votes
1answer
5k views

Custom entity operation links

I've built a couple of custom entities in Drupal 8 Vendor, defined as such: /** * Defines the vendor entity. * * @EntityType( * id = "vendor", * label = @Translation("Vendor"), * module ...
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 ...
3
votes
2answers
2k views

Migrate Drupal 8 install from one server to another

I've been using Drupal since 4.6 and it's always been easy to copy a site from one server to the other. Make up a tarball, do a database dump, go to the new machine, unpack the tarball and load in the ...
14
votes
3answers
12k views

How do I alter the route defined by another module?

In other words, what is the Drupl 8 equivalent of hook_menu_alter()? Drupal 8 still uses hook_menu(), but for what I can see, the information returned by the hook is different from what the hook ...
8
votes
1answer
327 views

How do I implement routes?

How can I implement the most basic route in Drupal 8? What files do I have to write, and which classes do I need to implement?
0
votes
2answers
2k views

How do I PUT update on a node using services 3

I have a node with field_order_status field(not required) in list(text) type and radio button widget and I want to update a node(nid:95) but my sample JSON PUT content(application/json) throws Status ...
4
votes
1answer
9k views

What is the use of has_js cookie?

I am building an Android app that talks to Services module using REST endpoint. When I post any content without setting the "has_js=1" cookie to the REST endpoint in JSON format, my content is never ...
1
vote
0answers
156 views

How to use services with Drupal 6 on server that does not support CORS

I am using Drupal 6 for my current website. I have confirmed that the server(Pantheon) running my Drupal 6 website on nginx does not support CORS as of now. I want to interact with this site using ...
2
votes
1answer
2k views

REST Service - 500 Internal Server Error

I has been trying to set up a drupal REST Server in my computer (a clean drupal 6 installation). Unfortunately, I could not configure it. When I send a POST message (WITHOUT parameters); ht.p://...
2
votes
1answer
1k views

how to enable CORS in Drupal 6?

I want to use services 3 module to create node of a content type in my Drupal 6 website. I have enabled Services 3 module and configured the Rest Server properly. But when I make a post call to it, ...
5
votes
1answer
703 views

Drupal 8 HTML markup and semantics

When building a bespoke site a pet hate is that you start with a front-end layout that is semantically sound and robust, but when you try and create said layout as a theme in Drupal, by default the ...
1
vote
1answer
552 views

unable to get custom service to return result using services module

I'm learning about web services and implementing it in drupal 6 and am trying to use Services module with its REST server for implementing a web service to add a user. Since there is an existing ...
39
votes
10answers
45k views

Manually disable a module

In Drupal 7, I could manually edit the {system} table in the database to disable a stubbon module. In my Drupal 8 site, this table is gone. How can I manually disable a module in Drupal 8?
0
votes
1answer
445 views

How to rewrite the value of an array element in page.tpl.php

I'm totally new to PHP programming and modifying the values of Drupal output with php customisations, so sorry if this question seems dumb. In Drupal 6 I need to rewrite the value of the array ...
8
votes
3answers
2k views

Is it acceptable to modify Drupal's composer.json file?

Drupal adheres to the best-practice of never modifying core. Drupal 8 has a composer.json file built into core, if you need to add a third-party library, should you modify composer.json, or is there ...
5
votes
2answers
371 views

Will Lime the future test suite?

Now that Drupal 8 is going to be based mostly on Symfony, is the TDD / unit testing going to change too? For Symfony, Lime is the preferred testing suite. Is that true for Drupal 8 too?
2
votes
1answer
1k views

Panels vs theming

Panels versus themes: What is the best way? Since Panels is included in Drupal 8 core, isn't it the way forward? Do we still need to design static HTML pages and then integrate them with Drupal, or ...
8
votes
1answer
2k views

Theme folder in drupal 8

In Drupal 8, the theme folder for contributed themes seemed to have moved. Where do themes go in drupal 8?
0
votes
1answer
296 views

Post-installation PHP crash [closed]

I decided to give a shy try to Drupal 8. Installation went quite smooth, but when everything was ready to hit the home page I was delighted with the following error: CRASH: PHP segmentation ...
3
votes
1answer
678 views

How much of Drupal 8 will rely on or be compatible with Symfony? [closed]

Now that Drupal 8 is being redeveloped with Symfony, and we are just about to go into the code freeze so that early adopters can start playing with it, what will it affect? Will we be able to write ...
3
votes
0answers
2k views

Services Module - Access Denied for User Admin [closed]

I'm trying to get a REST server going with Services, testing locally. It seems like things are running, but I'm denied from using any of the resources, even as an admin! I'm trying to follow the ...
0
votes
3answers
65 views

Allow public to edit content type

I have a content type that users can vote on so I need that content type to keep tally of the votes. I'm assuming I need to allow the public to edit that content type but, unsure how to go about ...
0
votes
1answer
639 views

How do I set the path to a custom view style template? [closed]

I have created a custom view style in a module. It shows up in the list of view styles, but when I try to output the resulting block I get the message: Warning: include(/var/www/core/modules/views/...
2
votes
3answers
2k views

REST won't work

On a Drupal6 installation I have the REST service enabled (6.x-3.3). All seems to setup correctly, but I cannot query any data and get always 404 Not Found. What is the correct URL for retieve node #...
1
vote
1answer
2k views

How do I attach files to nodes?

I need to add files to multiple value file field using drupal rest api (restws module). return format of restws is something like this : "field_files": [ { "file": { "uri": "...
2
votes
1answer
413 views

Is Drupal 8 with views in core stable enough to be used as a simple blog?

I want to start using the new drupal 8 codebase, but I was wondering if I can use it in its state now as a simple blog using views.
2
votes
0answers
53 views

Drupal Services returns javascript after results

I am using Services Views and have a view that returns the json array, plus a script tag (the default jQuery.extend(Drupal obj...). I do not want this jQuery.extend script to be added for a services ...
15
votes
2answers
6k views

How to create a empty module? [closed]

What is the most basic valid module one can create in Drupal? It would be useful to have a simple blueprint available, for anyone just getting started with Drupal.
1
vote
1answer
2k views

POST request trying to make a Session authentication in the REST SERVER return a HTML error 406 Not acceptable

I have a REST server in drupal working. I get data if I go to the server endpoint. In Navigator: http://localhost/drupal-7.19/restserver/user/ Work fine. I have created a PHP to make the Session ...
1
vote
3answers
2k views

Where place spyc library dependencies

I have a issue trying to activate REST SERVER from services. I need to add this library. I'm using drupal 7.19 on Ubuntu. Reading this question, I add the spyc.php in 'servers/rest_server/lib/' But ...
4
votes
2answers
2k views

Creating Drupal 8 route for AJAX requests

How should I implement a callback to a single Drupal class (in my case it's Transliteration). I don't need a full Drupal load/bootstrap, but one independent class. The purpose of the AJAX code would ...
2
votes
0answers
501 views

using facebook oauth with Rest Server

I'm building an Android app that communicates with Drupal Services 3 through Rest Server module. On Drupal side, I'm using Facebook oAuth module for authentication. so I want to let the app users ...
9
votes
1answer
811 views

How can I install composer packages with drush make?

How does one include composer package in a drush make file? The more general answer, the better. There's already a composer drush module allowing drush dl to handle composer packages, but that ...
2
votes
0answers
632 views

Retrieve site menus using REST API

I have a site where menus are created using Site building -> Menus -> List menus -> Primary links -> Add item option. Some of them have sub-menus under them. I want to retrieve these menus ...
3
votes
1answer
832 views

Using oauth_common in a module to authenticate with a web service?

I'm wanting to use my Drupal 7 site to communicate with an external API that must be authenticated via 3-legged OAuth. It seems there's a lot of documentation around about using Drupal as the OAuth ...
5
votes
2answers
3k views

Services module: What is 'Index' operation?

D7 / Services 3.2 retrieve / create / update / delete are very straightforward, make senses to me that matching 'CRUD', I don't understand what 'index' here does? Thanks.
9
votes
2answers
1k views

Drupal Services OAuth

I have been working on this issue for a couple weeks now, and I can't find a solution for the life of me. The fact that I have found no decent documentation (on Drupal's website, or anywhere else) is ...
27
votes
11answers
57k views

“The website encountered an unexpected error. Please try again later.”

I have this error with Drupal 7 how can I have some more information about this error ? Any report, any log anywhere ? Nothing in php errors. how can I disable that message and have a more useful ...
3
votes
1answer
3k views

Getting the entire index of nodes from REST API

I'm looking for a way to get all the nodes to be shown on my REST service. When I query the endpoint index http://server/api/node it only returns 20 results. Are there any additional parameters I can ...
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 ( [...
4
votes
1answer
424 views

Failure getting nodes from terms via the rest api

I have added a REST web service in Drupal and all content is tagged with taxonomy. I'm now trying to acquire all related nodes to the terms. First I'm calling taxonomy_vocabulary/getTree along with ...
1
vote
1answer
152 views

Creating SearchAPI searches without using Views

I am using SearchAPI on a website with 20,000 entities indexed. Searching through them with SearchAPI is pretty simple. Its fast. I want to keep it as fast as possible with very low overhead, without ...
2
votes
0answers
121 views

REST/Services: Only able to retrieve index. Everything else result in http error 500

I am pretty new to Drupal, and I'm trying to get a webservice running on my Drupal 7 site. For testing purposes, I made a Rest-service, with NO authentication, and all resource's added to it. I ...
1
vote
1answer
858 views

How can I use REST API to create a node with status/tags/data

Follow the Services module document, I can only create nodes using REST API with type, title and body. But I am not able to create nodes with more parameters such as tags, status and date. Need help.
-4
votes
1answer
3k views

Do we really need Blog module in Drupal 7 (and 8)? [closed]

In Drupal 7, the Blog module do not have any option to change the URL. Because I want a different URL, I build blogs without the Blog module. For blog pages, I make it using Views and theme ...
0
votes
1answer
242 views

What will be the post parameter when specifying vocabulary term?

I am trying to create a drupal node with a iphone app via rest server. I want to send the request to drupal as json. I have added a taxonomy vocabulary for categorizing the nodes. Specifying a ...
3
votes
1answer
4k views

Getting views data as a REST service

I need a way to get the output of a view as a REST service in JSON format. I read about the RestfulWS and the Services modules, but I didn't find enough documentation. Are these straight forward, or ...