This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Using Rest API in drupal 8 using custom code

Using this code you can call a Rest API from your custom drupal module to get or post data

 

 $client = \Drupal::httpClient();
  $request = $client->post('http://demo.ckan.org/api/3/action/group_list', [
    'json' => [
      'id'=> 'data-explorer'
    ]
  ]);
  $response = json_decode($request->getBody());

Using the rest API and the paragraphs_asymmetric_translation_widgets

Hi Everyone

I have been using the REST API with HAL JSON to succesfully import translated "pages". However I'm now in a situation where the client uses the https://www.drupal.org/project/paragraphs_asymmetric_translation_widgets. When I now use the same techniques I can't create translated pages with different paragraphs per translation.

I hope someone knows if this is even possible and how?

Much appreciated!

Kind regards,

Roel

how do i debug a silent failure?

I've an issue with my site that is annoying me - and does not give any error.

To be specific, it is the image multi upload tool - I can upload images, they appear in the folders on my server, but my front end behaves as if nothing has happened.

There are no errors displayed or logged.  Devel doesn't show anything as I am not submitted a page - I am only using functionality on a page.

I believe my code base is good, as I am running many sites on the same installation - and they don't have this issue.

Creating custom ajax command In Drupal 8

Hi guys,
I am writing this post to help drupal 8 developers for creating a custom Ajax Command to insert value in CKEditor in a node edit form, Like Body field of a node. Here are the steps:

Module that allows users to pay each other ?

Hello

I am building a website where a core function is that users can post something that shows up as a node. Users of a different class (user b) can see those and then reply with a monetary offer. The original user can review multiple offers and accept one in which a payment is made from the original used to user b. 

I was was wondering if there are any modules that would make this easier to make before I try to struggle and figure this out the hard way. 

Thanks 

Implementing hook_ENTITY_TYPE_access

Apologies for the elementary question, but what exactly do capital letters mean in a hook?  

I know capital letters indicate special handling in Drupal (similar to a parameter for naming hooks?).  So in custom modules, is it correct to say that ENTITY_TYPE in a hook name should be replaced with a value?

e.g. In the custom module, "mymodule", would you implement hook_ENTITY_TYPE_access as follows?

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions