Questions tagged [drupal-entities]

"Entities" is the term that in Drupal 7 is used for nodes, comments, taxonomy terms, and users. Third-party modules can then define new entity types.

"Entities" is the term that in Drupal 7 is used for nodes, comments, taxonomy terms, and users. Third-party modules can then define new entity types.

One of the features of Drupal 7 entities is that they can have associated some fields created through the field UI, or implemented by third-party modules.

In Drupal 8, the API to handle entities has been extended, and entities are now object of specific classes implementing the interface; support for saving entities in the database has been added, where in Drupal 7 saving an entity was done by procedural functions.

Reference

See also

37 questions
0
votes
0 answers

Drupal views shows html for field text_with_summary on custom entities

I created a custom entity "event" for a small event management module. This entity has several fields including a field "description". This field should mimic the behaviour of the nodes "body" field. The BaseFieldDefinition: $fields['description'] =…
0
votes
1 answer

Drupal 9: Get rendered view within Content type

I have several views that I need rendered within pages. I have a field to pull in these views as blocks within the content editor, but I am running into an issue where the only display options for this field I get are "Label" or "Entity ID". How can…
0
votes
0 answers

Not able to save block or view configuration or uninstall modules when a domain is selected

Drupal Version: 9.2.21 Domain module version: ^1.0@beta Expected Behavior After selection of added domains, The configuration saving and uninstalling any module should work as expected. Actual Behavior After selection of added domains, I am not able…
0
votes
0 answers

Drupal 7 creating a custom entity

I'm trying to make a form with some fields and save the values in Drupal 7 where every user can enter their data. I tried creating a custom entity with an existing database table like so: function bank_info_entity_info() { return array( …
max
  • 9,708
  • 15
  • 89
  • 144
0
votes
1 answer

How to make a Drupal Commerce configuration entity revisionable

I have an Ember application on the frontend consuming Drupal's JSONAPI. Drupal has the commerce module installed. The ember application is requesting all product_types, and needs to display information about the product types. The product type has…
0
votes
1 answer

Custom fieldable content entity not including GUI-added fields on form

I'm building a custom content entity in Drupal 8 and so far done ok. I've used Drupal Console to generate a module and a bundle-less entity for me and added custom fields to this entity using the GUI. I can load the form to add entities of this type…
AlbionBrown
  • 37
  • 1
  • 8
0
votes
1 answer

Argument 1 passed to EntityViewBuilder must implement interface, null given

In my Drupal project I have this error: Recoverable fatal error: Argument 1 passed to Drupal\Core\Entity\EntityViewBuilder::view() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in …
Javier
  • 395
  • 3
  • 18
0
votes
1 answer

Cannot create a new entity (created with ECK) through API using REST module

Here is my situation: I am using the ECK module with Drupal 8 to create entities and bundles, and the new REST core module to create API features. I have installed the REST_UI module, and I enabled the route for the entity I am interested in. Here's…
schankam
  • 10,778
  • 2
  • 15
  • 26
0
votes
0 answers

Where is the "Enable/Disable translation" value stored in the database?

Where is the "Enable/Disable translation" value stored in the database? I haven't been able to find this info anywhere.
0
votes
1 answer

Selector for input checkboxes Drupal 7

I am trying to hide a field based on what user is selecting from a entity referenced checkbox list but no matter what I do I cannot hide the field. I think some issue with the selector. $form['title']['#states']['invisible'][] = array( …
Neela
  • 311
  • 1
  • 4
  • 16
0
votes
1 answer

Drupal Save in "manage fields" page is extremely slow

I have an entity that has around 40 fields. When I try to save new fields/update exiting fields in the manage fields window, the save/post operation takes too much time (around 6 to 8 minutes). Sometimes the page is just refreshed and the newly…
perpetual_dream
  • 1,046
  • 5
  • 18
  • 51
0
votes
1 answer

Drupal 7 | Preserve file after entity_wrapper unset?

Question is quite simple: How to preserve file on server and in file tables, so its fid is still valid after unsetting/changing value with entity wrapper? $ewrapper = entity_metadata_wrapper('node',…
0
votes
2 answers

how to add fields from referenced node drupal 8

I have a content type that contains a field that is a reference to another node. I'm trying to include a field from the referenced node within the page for the main node, but I can't figure out how to add that. Here's how I'm getting the value…
Erich
  • 499
  • 1
  • 13
  • 34
0
votes
1 answer

Add values to 'config' table and 'key_value' table when creating a new field in an existing table in Drupal 8

I'm new to drupal. I need to write a module that need to handle user related details. I'm able to create the module and add the necessery database changes in 'users_field_data' table. by using db_add_field in…
0
votes
1 answer

Anyone else having trouble getting custom handlers to wrok on D8 entities?

I'm starting out with Drupal 8 and until now I have been quite impressed with all the new functionality. However, I have been trying to write my own entity and I'm running into trouble: This is the entity definition:
DragonEye
  • 11
  • 4