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

Create a content type programmatically

Hi,

I have come across a function protected function ContentTypeCreationTrait::createContentType() . But I did not come across any good examples online to create a content type using the function.

I would appreciate if you let me know how to create a content type using a title and machine name of my choice.

Error in setting the cardinality of field programmatically

Hi,

I am using the following code to set create a field programmtically and I am trying to set the cardinality as unlimited. But I am getting the error and I cannot add more values.

What url should be used for "source" in composer.json?

There is a documentation page that explains how to add a composer.json file to a project:https://www.drupal.org/docs/8/creating-custom-modules/add-a-composerjson....

In the example, the following is suggested for "source":

"source": "https://cgit.drupalcode.org/mobile_detect"

Ajax validation only works when I am connected

Hello !
I am new in Drupal world and I'm trying to use the Drupal From API to create a contact form with Ajax validation.
I'm facing an issues:

  • My following form (see below) works well but only when the user is connected as administrator. When I am not logged in as an administrator, ajax validation does not work.

Here is the form I created:

password decryption in durpal 7

I want to decrypt all users password into plain text . So how can i do it for drupal 7 ?

what is the new way of writing $entity->link()

Hi, 

so $entity->link() is deprecated in the latests versions of drupal 8, that means either it doesn't already work either it won't in a few months. And of course, despite spending hours looking online, I found no clear "new method" to replace it.

Does anyone has an idea  ? 

Cheers, 

'Why try making things simplier when you can make them more complicated ? '

French (joke) proverb. 

Pages

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