User Entity - Custom Validation Constraint

Hi, I've created a new field "nickname" in user account settings. I want to use custom validation constraint (https://www.drupal.org/docs/8/api/entity-api/entity-validation-api/providing-a-custom-validation-constraint) to make this field unique but I don't know what hook to use to add the constraint. Do you have any idea or alternative? Thanks!

How to represent complex relationships with Content Types?

I am working on a site to track my daily carbohydrate intake. I can represent a Food item that I might eat, say a taco as a Content Type. I would call it 'Food' and it would have fields for name, description, and # of carbs.  The problem comes with representing a meal. For a given meal, say Monday Lunch, I could eat several tacos and a burrito. I can't quite see what Content Type could hold entity references to multiple different Food nodes as well as an amount eaten of each Food node.

Save username/password in cookie and pre-fill when user login next time

We want to add a 'Remember me' checkbox in the login form.
On checking the checkbox and  submitting the form, we save the username and password in Cookies and we pre-fill when the user visits the login page next time.

But the page is cached with the cookie values and it's delivered to other users with the values.
It's major security threat.

How to achieve the feature without affecting other users?

Migration of forms from NON Drupal site to Drupal 8 Webforms

Hi 

How can I migrate the forms in the existing site (source: SQL) to webforms drupal 8.

Any pointers will be helpful.

Creating a custom MediaSource plugin which works with the media library

Hi all,

I have created a media source plugin by following this tutorial -> https://www.drupal.org/docs/8/core/modules/media/creating-a-custom-media...

However as I suspected it doesn't fully work with the media library module. The library shows uploaded media but it doesn't allow one to add new media.

Upon investigation is seems I may need to create the form by extending the class

Trying to set the Image title attribute in D8

I'm trying to set the title attribute of an image (multiple) field using hook node presave. I will ultimately be using the filename without the extension but for now I'd just like to get the title to set then I should be right to build that variable.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x