Questions tagged [entities]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

Custom rest module: No route found for POST

Hi everyone i've been working on a custom rest module for Drupal. I wrote the following Resource class: <?php namespace Drupal\aker_platform\Plugin\rest\resource; /** * Provides a License ...
0
votes
0answers
4 views

Images get deleted when uploaded to a theme settings field

I've got some custom text_format fields set up in my theme settings, but images don't seem to be working correctly with them. For some reason images uploaded to these fields don't get marked as "used" ...
0
votes
0answers
9 views

Inline entity form module fails when creating a new node and the reference method is Views

I have a Drupal 8, core version:8.8.x project, i'm using inline entity form module(latest version) for entity reference fields. Also i have tried using entity connect module but it caused various ...
0
votes
1answer
545 views

I need to reference a custom field I created in User Profile

I used Drupal 7 computed fields to calculate weight loss. This is what I current have. Which works in a sense but only where the user inputs their initial weight and subtracts their current weight to ...
-1
votes
0answers
15 views

Is it possible to use a content type as data-entity-type?

I can use the following snippet to insert a media image into content: <drupal-media data-align="right" data-entity-type="media" data-entity-uuid="da0c27fd-211a-4f25-9318-dde2955635fc"></...
0
votes
0answers
18 views

Can't resolve “entity_name needs to be installed” on custom entity

I'm working on creating a custom config entity and I'm pretty confused. I created it via Drupal CLI, configured some fields, adjusted the schema.yml file, and everything is working. I read that I ...
1
vote
1answer
442 views

how Drupal refresh/rebuild its route automatically after route programmaticaly created?

I try to understand how Drupal Core rebuild the route automatically after route created programaticaly. here is one example that i tried: I'm installing External Entities Module. this module will ...
0
votes
2answers
897 views

Inline entity form prepopulate

I have a content-type A which has a reference field to another content-type B. When creating/editing content with type A I let the user create/edit content of type B using the inline_entity_form ...
0
votes
1answer
574 views

How to setup multiple currency drop down

I have basic content type setup (No commerce or ubercart) which display price as a text field and that value has been used in 5 computed fields. Now i like to make that price field in drop down ...
2
votes
2answers
1k views

How to override a module theme function in a custom module but still allow themes to override the template file?

I'm writing a fairly simple module which allows the removal of colons from field output on a per field basis and I need to override the core field module's theme_field function in my module. I can ...
0
votes
0answers
20 views

Display taxonomy field in view on content page

Using Drupal 8.8.1, I am trying to display taxonomy fields in views on content pages tagged with that taxonomy. Essentially the content page would have an image header from the taxonomy image field, ...
2
votes
1answer
539 views

Is it possible to get Entity Connect and Entity Reference View Widget to work together and if so how?

It seems to me this should be a fairly common problem, but I can't seem to find and answer despite looking! Here is my use case: I have two types of content: Activity and Participants. When I create ...
1
vote
1answer
804 views

How can I make a template for a product type in Commerce?

I want to be able to write my own markup for the fields (see image below) of each product type – how do I do this? My main reason for this is that I want to group them with my own HTML rather than the ...
1
vote
1answer
550 views

How can I conditionally reference an entity?

I would like to have an inline entity reference form that will optionally provide a write-in text form if the entity doesn't already exist. Here's the use case: I want to reference a faculty profile ...
6
votes
2answers
4k views

Attempt to create a field body that does not exist on entity type node

I am getting the following error: Drupal\Core\Field\FieldException: Attempt to create a field body that does not exist on entity type node. in Drupal\field\Entity\FieldConfig->...
0
votes
2answers
164 views

Creating a block type programmatically

I want to create a block type that has a couple of fields, a template and attached js. I want that the user in my site will be able to create blocks of this type just like they create a custom block :...
8
votes
4answers
21k views

How to use presave hook to save a field value as node title?

I have a custom date field in a node type 'day'. When the node is saved (or edited then saved), I would like to get the field_date value (not the published date) and save it into the title field. I ...
1
vote
3answers
2k views

Reverse entity relationship

I have several custom content entity types that have relationships to each another. The fields used are defined as base fields and I am using $fields['FIELD_NAME'] = BaseFieldDefinition::create('...
1
vote
3answers
1k views

How do I update a user profile with entity_metadata_wrapper()?

I got an error while updating user profile data such as name,password and email. I am using entity_metadata_wrapper() for processing update. exception 'EntityMetadataWrapperException' with message '...
3
votes
1answer
84 views

How can I determine which module is associated with a field plugin?

I'd like to implement an entity hook, and act on all fields defined by Computed Field FieldType plugins. So I either need a list of all FieldType plugins provided by the module or need to know which ...
0
votes
1answer
576 views

How to show an Inline Entity Form on a PM page or panel?

I'm trying to include an Inline Entity Form on a panels display (via ctools Page Manager). The Inline Entity Form field is attached to users, and the page in question has the user's context. The ...
0
votes
0answers
30 views

WidgetBase with Ajax Callback and manipulate #tree values

After many tries, maybe someone can help me here. I want a dynamic form field in a widget base, but I keep having problems. 1st Values of the submit button are lost after submit and can´t manipulate ...
1
vote
1answer
596 views

How to override template for view mode of a entity within a module?

I see in theme suggestion array that I can override template for my custom entity type based on view mode like this: custom_entity__custom_entity__view_mode_name Now I want to put custom-...
0
votes
1answer
439 views

import multi-value from csv into entity reference field from a field collection

I posted this question at https://stackoverflow.com/questions/39234531/import-multi-value-from-csv-into-field-collections but I have not got any replies yet. Below is the summary: I have a simple csv ...
1
vote
1answer
877 views

How do I customize node.tpl to print an entity reference field in a specific format

I have content type called collection that has an entity reference field (multiple) that references another content type called books. One the collection node page, I want to render all of the books ...
1
vote
1answer
313 views

How to get a field third party settings for every content entity forms

Can someone explain or post an example of how to get a third party field settings on every content entity forms? I'm looking for a generic code where a form can be customized (like calling a custom ...
0
votes
1answer
393 views

“Image Upload Button” section remove after click on upload

I am trying to edit users's profile page in Drupal 7. I have an image upload button there, but it remove (hide) after click on upload button . But If i login with admin its working fine, means image ...
0
votes
1answer
808 views

Cloned node entity reference field stay in sync with parent node

I have three content types A, B and C. A have entity reference fields to B and C. I create a Node of type A say a1. When i clone a1 node as a2 with node clone module i get the same value for entity ...
0
votes
1answer
713 views

How to download the files data attached to webform

I have webform with text fields and file upload field. How can i download the all the documents which was uploaded through this webform.
0
votes
1answer
719 views

Add classes to programmatically added fields

I have programmatically created a few content types and fields for said content types in a module I'm building, but I need to add classes to said fields. So if I have a text field called "...
10
votes
2answers
12k views

Programmatically get all names of an entity reference field

Example: I want to get all tag names that are inside field_tags of node 5. I can get the target_id with $node->field_tags->getValue(); But the problem is, I don't know what entity the target_id ...
0
votes
1answer
563 views

How do you output and modify the Content:Path variable using field:PHP global?

I'm trying to modify the content:path variable using PHP field in Views for Drupal 7. The $data and the $row->path gives a blank result. Anyone know why? It seems that I can grab it via the $views ...
1
vote
0answers
102 views

EntityMetadataWrapperException when updating Open Atrium

I've taken over management of a site using Open Atrium on the Pantheon hosting platform. The upstream repository was originally set incorrectly to Drupal 7 instead of Open Atrium. What this means is ...
1
vote
1answer
622 views

dynamically populate a select field based on the selection in another field works only the first time

I am trying to dynamically populate a select field (chamiponship) based on the selection in another field (country). It works fine when I load the page but just the first time, the second time I ...
0
votes
0answers
17 views

Image Alt and Title fields aren't migrated

I'm in the process of D7 to D8 migration, I generated config files using drush and running individual configuration based on my needs. When I run upgrade_d7_file.yml all my images are migrated but ALT ...
2
votes
1answer
671 views

How to check in a rule if the data from a field collection has changed?

I want to add a rule (using the Rules module) for printing a message after changing a field in a field collection. The field collection consists of the following three fields: Reference to Version (...
0
votes
2answers
577 views

Embed a node add form on a parent node

I have a product display node and I'm trying to add a rental form to the node so that anyone can submit a rental form and have that reference the node. I was thinking of making the rental form a new ...
3
votes
2answers
766 views

How do I get JSON data from a custom entity

I would like to GET JSON data from drupal 8 custom entity. I am using ubuntu 14.04 and vagrant. For that i have done these steps. I have taken reference to Create drupal 8 custom entity from this ...
1
vote
2answers
653 views

Hide Alt and Title for image field

How to hide Alt and Title fields for anonymus users when they upload images? I use tokens for these field that's why I need to hide them.
2
votes
1answer
1k views

How to expose filter for entity reference as dropdown in the Search API view?

In my Search API view, I'd like an Exposed filter > Entity reference to be a select box, not a text field. Details I have a view which I created like: Views > Add new view > Show: default node ...
1
vote
1answer
401 views

How to submit a field collection from a form into a created node

I would really appreciate if somebody could help me with this :) I have a field collection called field_formations. Inside it I have 2 fields: field_technologies - (reference to a taxonomy). ...
1
vote
1answer
602 views

Adding conditional statements as Math expression to custom text fields in views

I have created views in which i have added custom text and Math expression. I displayed view in table format I created one Math expression which is noticed below: [Field 1] - [Field 2] I have ...
0
votes
1answer
18 views

how do I get the parent node of an entity reference node

I have two content types - A and B. For content type A, there are 5 content items - Aa, Ab, Ac, Ad, Ae. For content type B, I have two items Ba, Bb. Content type B has a field that is an entity ...
2
votes
1answer
1k views

Migrate row data into drupal text formatted long multiple

I would like to import 3 different row values into a multiple text formatted long field. This is my migrate (plus) map yml: ... field_mytext_formmated: plugin: get source: - ...
1
vote
2answers
5k views

Get the uri/path value of an image in the field template

I have created a custom field template for an image - field--field_images.tpl.php with the following code: <?php $url = file_create_url($field_images['uri']); $url = parse_url($url); $imglink = ...
1
vote
1answer
1k views

Entity query for distinct field

I have an entity line_item with the following fields: id uid (entity reference) product (entity reference) ... I would like to get all distinct products (product ids) for a specific user. I tried ...
1
vote
1answer
3k views

Create a field collection field programmatically

Is there a way to create a field collection programmatically? I saw this code: $field_collection_item = entity_create('field_collection_item', array('field_name' =>'field_text')); // Create new ...
2
votes
2answers
438 views

Values don't get saved to the database when fields are wrapped in a container

When I wrap a field in a container, the field value doesn't get saved to the database. But if it lives in root, it works properly. public function formElement( FieldItemListInterface $items, $...
-1
votes
1answer
2k views

Entity metadata wrapper + entity reference + translation

I have two node types: 'festival', which can be translated and 'event', which untranslatable. Event has multivalued field reference to Festival, so that one Event referenced to all translated festival ...
1
vote
1answer
594 views

How to render / preprocess list of entity reference nodes?

I hove a content type that editors can 'attach' related nodes to. When I 'theme' / 'style' nodes of this content type through view mode everything is basically fine: the related nodes are rendered ...

1
2 3 4 5
169