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

This one feels a bit strange

Hi All

I am trying to create a custom form and thought I had it cracked but have one error I can't figure out

In my src/Form/CustomForm.php. Everything I have read suggests the following should work but it doesn't

$node = \Drupal::routeMatch()->getParameter('node');
        $nid = $node->nid->value;

here's fuller code, can anyone see what I am doing wrong, am I missing a use or something?

Hide Status and revision information on display form view mode

Can I ask if anyone knows how I can remove the status and revision information please, I can't figure it out.

Thanks

Creating a custom function and calling it

Hi All, 

New to Drupal 8 coding so right at the start of my journey and I have a question.

I want to create some reusable custom functions for my custom module, and I'm trying to follow what I believe is the correct approach by putting my reusable custom functions inside the src directory and then using as a namespace, but I have never tried this before and can't get it to work.

I have tried the following which doesn't work so hoping someone will be kind enough to explain what I am doing wrong.

in my .module file I have

AJAX form : prepopulate an entity reference multi value field depending on a select list

I'm creating  a mail interface.
I need to prepopulate an entity refence field depending on a list selection field.
The entity reference field is defined in "message.php"

Help with RESTful Post with relationships

Hello, and firstly I apologize if this is the wrong place for this question. 

I'm new to Drupal and rather new to RESTful services. I am trying to add content via a POST and for the most part it works, the only problem is filling out fields that have related data. 

My JSON file is as follows:

Pages

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