Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [entities]

Nodes, comments, taxonomy terms, and users, using the terminology used since Drupal 7, are generally called "entities."

3
votes
0answers
89 views

How to convert an existing D8 image field into a Media Image reference field?

I have an image field that I created before Drupal 8.5, when media was introduced in the ui. The field already contains content and I would like to make use of the reusable media functionality that is ...
3
votes
0answers
49 views

Benefit of config entities over regular config entries?

In Drupal 8 it is possible to store configuration in "config entities". However, the same can also be achieved with non-entity config entries. E.g. one example for a config entity schema, from core....
3
votes
0answers
19 views

Can I use safe_value when the recommendation is to use a name containing only letters, numbers and spaces?

Commerce Credits says that the credit name should It is recommended that this name begin with a capital letter and contain only letters, number and spaces. This name must be unique. I am ...
3
votes
0answers
56 views

A reliable way to set #required on form fields that are attached to a form via field_attach_form

I need to be able to reliably set #required = TRUE on form fields that are attached via field_attach_form. Some fields might be $form['field_name'][LANGUAGE_NONE]['#required'] = TRUE while others are ...
3
votes
0answers
69 views

How to modify auto populate field value?

I m Stuck in two situation where I have to modify value of one field depending on another field selection. First situation is like I have two field Region (Node reference) - the widget type is ...
3
votes
0answers
63 views

Why Each user can modify flag field of other users by VBO(Views Bulk Operation)?

I have many users, and I have a flag and also flag field. users can flag contents and add value in flag field when they are flagging a content. for modifying flag field I'm using VBO Module. But each ...
3
votes
0answers
238 views

How to create additional base fields for ECK entity

For example I want to create a Vehicle ECK base type and Car and Truck bundles, but I want to define fields for the Vehicle base type that would be shared between Car and Truck. In UI, by default, I'...
3
votes
0answers
913 views

How set default value for entity reference field

I want set a default value for my entity field reference refer to his parent. I am on his parent and with a link i load a popup with the form of the child : My parent is in the URL param value 2 for ...
3
votes
0answers
64 views

How to reset a Field Collection to its basic, unpopulated state via hook_form_alter()

I am doing a form alter on a node edit form with a Field Collection which may have been previously populated. I want to discard any previous data entered into the fields within the collection so it ...
3
votes
0answers
192 views

How do you add the NID as a view filter criteria and not contextual filter?

I'm using an Entity Reference field, displayed as a View, to select an "Work Entry" node type. The Work Entry nodes are selected when creating/editing an "Invoice" content type. So the user will be ...
3
votes
0answers
1k views

Contextual filter based on translated term

I'm looking two days for the right answer but can't find it anywhere. Here is my issue: I'm using Drupal 7.21 with Entity Translation to build a multilangual site (English and Dutch). English is the ...
3
votes
0answers
348 views

PHP code not saving in a Computed Field

I'm using Drupal 7 and the Computed Field module. I have this problem with both the Custom Content Type and Custom Entity Type. When I add a computed field and go to the Field Settings, I type some ...
3
votes
0answers
2k views

Views “Content: Title” as a select list exposed filter?

Now I know how to display the "Content: Title" exposed filter field as an autocomplete widget, but can I output this field as a select list too? Are there any modules to do that? (I know this can be ...
2
votes
0answers
134 views

Configuration sync with deleted field

I have a field field.storage.node.field_create_ic created with type 'calendar_download_type' and it is one of the contributed module (ics_field). Now, in my local environment I deleted the field and ...
2
votes
0answers
72 views

Single vs Multi-step Form - Hundreds of fields

I'm looking into enhancing an existing entry form on a Drupal 7 site. We currently are using a single content type and the field API to store all of the data. It already has 46 fields on it, but the ...
2
votes
0answers
122 views

Exported field collection field has null UUID

In D8, I have a configuration management error. I have created a field named 'field_icon_link' of type “Field Collection”. I export my config. If I try to import this config I get a UUID error. ...
2
votes
0answers
217 views

Check if config_translation exists in specified language

The following code loads all configuration entities of a given type: $entities = Drupal::service('entity_type.manager') ->getStorage('ENTITY_TYPE') ->loadMultiple(); However, this will ...
2
votes
0answers
106 views

Template name suggestion for multivalue image field in paragraph module?

How can I create a dedicated template name suggestion for paragraphs multi value image field? The below HTML comments are the theme hook suggestions added by the debug function, for the paragraph ...
2
votes
0answers
60 views

How can an Entity Reference filter against another field?

In Drupal 8, I have a content type for "Advances" that contains an Entity Reference field to "Technology". Each instance of an Advance should be of a certain type of Technology, which has Prerequisite ...
2
votes
0answers
65 views

How to get the specific field raw data in node.html.twig

I am using link field in a couple of content types, but when I am trying get url from node.html.twig with content.field_my_link_field and have tried some suggestions like content.field_my_link_field....
2
votes
0answers
76 views

Additional field settings without creating a new field type

I'm trying to add 2 options to the field settings of all fields of a particular field type, in this case file field. To add the fields to the form I'm using mymodule_field_config_edit_form_alter() ...
2
votes
0answers
461 views

Is there a way to pass additional variables into a twig field template, from another twig template?

I appreciate that this requirement might be fairly uncommon, and perhaps against the pure Drupal approach, but I'd like to pass additional variables to my field template, from another twig template. ...
2
votes
0answers
92 views

Is ContentEntityBase::access affected by hook_ENTITY_TYPE_access?

Are calls to the access() method on entity objects which is provided by ContentEntityBase affected by hook_ENTITY_TYPE_access()? I am asking because the Paragraphs module, in src/...
2
votes
0answers
767 views

How to use map base field definition in a custom content entity form

I have a custom content entity and i'd like to use a map BaseFieldDefinition type to hold an arbitrary number of options. This is in my custom content entity baseFieldsDefinitions(): $fields['...
2
votes
0answers
321 views

How do I begin to debug an EntityMetadataWrapperException error on searches?

When trying to run a drush cron on a Drupal 7.54 site, I see the following error. $ drush cron WD cron: EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required ...
2
votes
0answers
373 views

Event subscription for EntityTypeEvents

So I'm trying to get an event subscriber working for EntityTypeEvents and I can't figure out why it's not firing. This is a general outline of the code: namespace Drupal\subscriber_class_module; ...
2
votes
0answers
92 views

How to render fieldgroup programmatically?

I have got the fieldgroup info from field_group_info_groups() , but how to attach this fieldgroup to a custom form I am building?
2
votes
0answers
58 views

How do I get back JSON value using entityform?

I am using drupal 7 entityform in this case, as i want CRUD functionality with the form. Can anyone tell me how should i configure my services. As of now i have configured it manually, selected the ...
2
votes
0answers
113 views

Prepopulate taxonomy field

I'm writing a module that use Taxonomy terms for different data (cast, directors, ... of a movie). Now I prefill some default fields to a create node page using the hook_form_alter. The only prefill ...
2
votes
0answers
917 views

Render entity with twig

I am using Drupal 8. I have a content type of Browse that has a bunch of paragraphs that can be inserted into each field_region. Inside field_region_iv_d I have a reference entity field that just ...
2
votes
0answers
32 views

Is there any way to use comments for taxonomy pages?

I want to add a block like message board/chatbox in my taxonomy pages. Best and simple way to do it is comments. Is there any way to use comments for taxonomy pages?
2
votes
0answers
75 views

#states in formElement for a FieldWidget

Does #states in formElement doesn’t work the same way it does in buildForm ? I have a field widget where I have a Form for the widget which has a #states in a container. But it’s not working whereas ...
2
votes
0answers
471 views

Show more in Autocomplete reference content than the title (id)

In the Edit Content Page I try to see in the autocomplete field of type reference not only the title (node reference + ID) but also another field of my chose. Can I do that in Drupal 8 trough a view? ...
2
votes
0answers
414 views

Drupal 8: set (sub) fields of the address field optional (not required)

I need an address field that allow the user to encode only a country OR a country with some other fields he could choose freely. I other words, I need an address field without any required field. To ...
2
votes
0answers
183 views

Displaying Token Field Labels From Fetched Entity In Rules HTML Email

I am sending a MIME HTML email using rules. Much of the information contained in the email comes from a fetched custom entity (custom ECK entity). Using the available replacement patterns, I can get ...
2
votes
0answers
462 views

How to properly programmatically add field collections to an entity in drupal 8?

What is the proper way to programmatically add a field collection to an entity in Drupal 8? I can't find this online. This is what I'm using and it seems to work. The tricky part is setting the ...
2
votes
0answers
22 views

Fields vanished in node edit form

In node edit form, I am not able to see any other fields other than body field. Though the field values are displayed in the node view page. For debugging, I tried to print the form value in form ...
2
votes
0answers
74 views

How do I allow my custom entity to be rendered using an entity_reference field?

Using Drupal 8, I created a custom entity, configured a few view modes for it, and then added an entity_reference field from another entity to my custom entity. In the display configuration for my ...
2
votes
0answers
30 views

Create Content with entities to link to another content's sub entities

It's kind of difficult for me to phrase the question, but I'll still try: My goal is to create several pieces of content that are referencing each other. But one content type has number of entities ...
2
votes
0answers
405 views

How to export entity instances created with ECK?

I have created my custom entity types (and bundles) using ECK module. Is it possible to export entities from website, for example using Features? I have found this thread but as I understand, it is ...
2
votes
0answers
150 views

How to theme drupal entityforms

I have created an entityform "Submit your proposal"(Machine name: submit_your_proposal). I would like to theme this form as per my site theme. I gogled, but didn't find the exact result. The form ...
2
votes
0answers
482 views

How to import allowed values lists into Drupal 8?

I have a Drupal 6 site, with some fields that allow you to pick from a list of allowed values. These values are then stored/linked to the node/entity. After migrating from the old site, these values ...
2
votes
0answers
195 views

D8 Use Mongo for custom entity storage

Thanks to Drupal 8 new field storage architecture, we can read everywhere that we can use other database than Sql, for example MongoDb, to store fields data. I have a custom entity with some custom ...
2
votes
0answers
406 views

Many to many in drupal 8

I have googled and read many posts on entity reference, taxonomy etc... Here is the problem: I have a procedures entity and sequences. Procedures can have any number of sequences. The same sequence ...
2
votes
0answers
337 views

Split multi-value field across columns in table View?

I have a Taxonomy with a geographical hierarchy (Region > Province > City > District), which I'm adding to nodes using the Hierarchical Select module. Because I set the field to "store the full ...
2
votes
0answers
31 views

Adjusting Drupal views filter

Can someone please help me to adjust views filter in Drupal. I have content type with field collection and it is displayed through Field collection views module. Also, I have a field collection ID ...
2
votes
0answers
64 views

Custom action SQL update not executing?

I created a custom VBO action to change a value in the selected item. I have the button displayed as "hide item". When I activate it on the item it doesn't seem to fire and change the value at all. I ...
2
votes
0answers
51 views

View with a reference to a reference as filter

Here is the structure: Content type: Document Entity reference (multiple) to: Specialization Content type: Specialization Entity reference (multiple) to: Department I have Entity Reference and ...
2
votes
0answers
242 views

500 Internal Server Error : An error occurred(0): Unknown data property field_group_privacy

I am trying to Create Services to Create Node Type Discussion in a Group using Services Module, but getting the error : 500 Internal Server Error : An error occurred(0): Unknown data property ...
2
votes
0answers
33 views

Customize theming for field collection in node add form

I have a field type Field Collection in a content type (I set it to have multi value). In field collection including some fields and I want to show the fields in the field collection in table format ...