All Questions
2,664 questions
0
votes
1
answer
30
views
How do I display the title of the entities to which the user has no access?
I created a new content type with entity references to standard pages. I am using the Taxonomy Access Control module to control the access to these pages.
When users view a node of that content type, ...
0
votes
0
answers
39
views
How do I know what properties and methods are available to an entity_metadata_wrapper object?
It may be easiest to start with an example.
The entity_metadata_wrapper() function seems to do a lot of complex magic behind the scenes in order to return an object with all data related to the entity ...
0
votes
2
answers
1k
views
How to make the float field accept decimal values?
I am using Drupal 7 and have a float field. It is used to enter prices.
Most of prices I enter have decimals (e.g. 101.82, 99.88). Some of the prices are negative values (e.g. -55.52, -1009.88).
...
0
votes
1
answer
103
views
Validation doesn't show an error when the value entered in the field doesn't respect the minimum length
I am using the Field validation module to validate a text field using the Length rule with a minimum length of 1.
When the field is left empty, no validation error is shown.
Setting the field as ...
0
votes
1
answer
632
views
Set a Data Value from Text field to Term Reference field
Node has two fields:
Text field
Term reference field (autocomplete?)
The Text field is old and already has 500 nodes with 500 unique values.
The Term reference field is new and needs to contain same ...
0
votes
0
answers
60
views
A new field doesn't show on the page
I recovered a site from a backup which had run on Drupal 7.7. I upgraded it to Drupal 7.80 on another instance. Now, we need to add new fields to content types and add new nodes. I added a field as an ...
0
votes
1
answer
28
views
IF statement to check if loaded entity is of type
In my module (fork of ECK Clone) I'm trying to set a default value when an entity of type "Course" is cloned.
Currently I do:
function eck_clone_clone_entity($entity, $account = FALSE) {
$...
0
votes
1
answer
105
views
Entity reference additional field
In D7 I have two new node type defined e.g. branch and leaf. The branch is a collection of leaves that I'm referring to using the entity_reference module. In the picture below the leaves are the nodes ...
1
vote
0
answers
48
views
Field type where big data is not loaded into memory if not needed
Background
Normally when an entity is loaded in D7, the 'field_attach_load' step will load all the data from fields into the entity object.
The field_sql_storage_field_storage_load() loads the data ...
0
votes
1
answer
30
views
How to render full profile2?
I am tring to load a full profile2.
I a trying the following code
<?php
$uid = user_load($node->uid);
$profile2_p = profile2_load_by_user($uid, 'profile2_profile');
print render($profile2_p);
?&...
0
votes
1
answer
58
views
How can I send mail containing rendered entity from referenced field?
How do I code a function for sending mail containing a rendered entity that is referenced from a field?
I have content type A that contains static information, and content type B that users create and ...
0
votes
1
answer
106
views
Autocomplete field where title is replaced with NID
I'm using Drupal 7 and I have made autocomplete function to be called on a field.
File my_module.module:
<?php
function my_module_menu() {
$items = array();
$items['/...
1
vote
1
answer
61
views
Get order of a content type's fields
When I manage fields in content type edition I can put them in order. How could I retrieve this information to use it in a custom module. In Database there is no any column which saves weight order ...
0
votes
1
answer
99
views
Have a child node inherit taxonomy from a parent during /node/add?
In Drupal 7, I have two content types:
Parent Events with tags (like "outdoors" or "popular" or "suitable for kids"). "Tags" are taxonomy terms in a vocabulary,...
0
votes
0
answers
24
views
Incorrect field of a content type in its display after migrating from a backup
The following two screen shots should explain the issue well:
Here I have a content type Poll, where the first field is Question with machine name title. However, in Managage Display tab, the second ...
0
votes
3
answers
170
views
How do I add a filter to a checkbox list in a content editing form
I have a taxonomy select field within a node form (7). I've chosen checkboxes and it is hard to scan them. I'd like to be able to add a filter so that the user can enter text to limit the number of ...
1
vote
0
answers
115
views
Entityqueue + inline entity creation?
Background / use case
The entityqueue module is a great way to bridge content with configuration:
The entity queue is created in config, and created automatically on deployment. It can then be ...
2
votes
1
answer
36
views
How to dynamically make a field visible? [closed]
I'm trying to render a field based on a select value. However I couldn't succeed for now, so here is what I tried:
I created a content type with a select field (field_type)
var_dump($form['...
0
votes
0
answers
115
views
Querying entities taking an insane amount of time
Is the entity system in D7 not very well optimized? I am trying to iterate through 1500 entities using EntityFieldQuery(), and I had to extend my execution time to 300 seconds in order for the ...
0
votes
0
answers
324
views
Getting "EntityMetadataWrapperException: Unknown data property" error when I delete a users custom field
I have added extra fields to the user object.
One of the fields I have added was a Skype text field to hold the user's Skype contact information.
The field had a machine name:
...
0
votes
0
answers
17
views
Items removed from Node Reference field are still displaying on the node
This problem only very recently cropped up; I've never encountered it before.
I have a content type (Resource) that contains a Node Reference field (pointing to Organization nodes) that allows ...
1
vote
0
answers
52
views
How to mark related entities as dirty in search api module when edited?
I am using Drupal 7 with the search api. I understand that one of the 'common pitfalls' of the search api is 'Changes in related entities don't lead to re-indexing'. I am bringing in a field called '...
0
votes
1
answer
139
views
Entity wrapper save using db_transaction()?
I am using a db_transaction() for some data updates. I am using some EntityMetadataWrappers, modify some data, then save.
The thing is, the wrapper ->save() function doesn't have a parameter for $...
2
votes
1
answer
47
views
Is there a way to get the max size of a varchar textfield?
I have an entity with a textfield created using the core Fields feature that looks like this when I inspect the type of the field table in the database varchar(40).
I want to be able to determine max ...
0
votes
1
answer
247
views
How to join the `field_data_field_*` tables with `node` table using SQL?
I apologize if I ask for something obvious, but I am asking because I could not find a simple answer anywhere.
I know how to work with these tables in the PHP Drupal code, which built-in functions to ...
0
votes
0
answers
117
views
After saving entity bundle, entity_get_info('node') missing 'token type' property
After saving any entity bundle, e.g. node type on admin/structure/types/manage/node-type page, node 'token type' is gone:
$info = entity_get_info('node');
// isset($info['token type'])) == FALSE
...
0
votes
1
answer
38
views
Adding fields to user registration form for admins
I use the Entity Registration module and I created a registration form for specific events in a Drupal 7 site. For the registered users, the fields are name, surname, birth date, upload administrative ...
1
vote
0
answers
130
views
EntityFieldQuery: Filter by field language
How would I use EntityFieldQuery->fieldCondition() or similar to filter by field language? E.g. give me all nodes where field_description has items in English, or in LANGUAGE_NONE?
There is a $...
1
vote
1
answer
58
views
Must at least one bundle have the same name as the entity in hook_entity_info()?
I'm working with hook_entity_info, and I'm defining an entity which will have multiple bundles.
Do I need to define a bundle which has the same name as the entity, or will the base entity become ...
0
votes
0
answers
40
views
How can I display a selected value of a multivalue entity reference field?
I have two content types A and B.
There is a multi valued field Persons in content type B. I have created a node of type B and enter two values in Persons field, X and Y.
Content type A has an ...
0
votes
3
answers
1k
views
Adding field collections programmatically
I'm trying to add a field collection to my user account on an event, and it seems to be being created properly, the fields are updated as expected and it parents it to the user account, however, even ...
0
votes
1
answer
200
views
Finding entity/webform fields in the database
A bunch of user accounts were deleted and recreated with new UIDs, and so any webform submissions or entities that have fields pointing to the old UID are now broken/wrong. I already updated some UID ...
0
votes
0
answers
54
views
Entity reference Autocomplete widget performance issue on add/remove
I have created content type and using entity reference module.I am facing very slow performance on entity reference Autocomplete widget while add more or remove option in admin side. Its taking time ...
-1
votes
1
answer
35
views
Entityreference multiple choice
I have an entityreference field on users and I can't find a way to select more than one value. I want to make like a multiple select, but with the entityreference.
I use the EntityReference module, ...
1
vote
1
answer
173
views
Does the summary area support input filters?
I have noticed that text filters placed in the summary area don't seem to work, that the raw text appears in the summary info when posted in Twitter, Facebook and the like.
Is that some inherent ...
0
votes
1
answer
211
views
Conditional clauses with Entity field Query
I have a syntax issue on using conditional clauses with EFQ, but the documentation on drupal.org is a bit unclear for me. I have google the whole Internet for this with no results at all. My hook ...
0
votes
1
answer
54
views
Update the author_uid for an entity registration
I'm looking to update the author_uid for an Entity Registration in Drupal 7 programatically. I want to replace all anonymous users with the UID of 0 with another UID lets say 2 upon saving the ...
0
votes
1
answer
68
views
entity_load not fetching the updated column
I've a custom entity {my_table} and added a new field in schema file as follows
/**
* Add {new_column} field to {my_table} table.
*/
function MY_MODULE_update_7100() {
$table = 'my_table';
$...
0
votes
1
answer
409
views
Entity Reference - User reference field Hide "Restricted access" label instead of showing useless choices
i have an entity reference (7.x-1.5) select-list within a checkout pane which is being used to allow the user to attach a child to a product during a checkout process.
The user can add multiple "...
2
votes
1
answer
43
views
How to write hook_field_placeholder_info() for the link module?
The contributed project
Field placeholder
lets one use HTML5 placeholder attribute. The project page says:
By default, this module integrates text, number and mail modules,
but any other widget ...
0
votes
1
answer
913
views
Webform field options missing Entity Reference?
We're using Webform 3.27 in Drupal 7 (not my call, don't yell at me) and it looks like one of the field type options should be Entity Reference, but we don't have that option. Not sure what's going on ...
1
vote
1
answer
285
views
How to add an extra field in file upload widget?
I know that it is possible to enable a description field in the core file upload widget for Drupal 7.
However, I want to add an extra description field like the one already present. For this I've ...
0
votes
2
answers
67
views
Available node language only English
I have a custom content type with "Set custom language as default for new content" and "Require language". Custom default language is Current language.
Entity translation is defined with "Current ...
0
votes
1
answer
62
views
Update image tags using entity metadata wrapper
I'm trying to bulk update image tags using entity_metadata_wrapper.
I'm unable to see the image field when I use $emw->getPropertyInfo().
The bundle is called hub_page.
The code I'm using is:
$...
0
votes
1
answer
38
views
Display node with mixed languages
My nodes, with entity translation enabled, need to be able to handle a node where the content of the node is displayed differently regarding the labels and menus.
Let's say I am on a french page, ...
0
votes
1
answer
80
views
Get list of nodes by field-collection value
I am having field_feature as a collection of fields (field-collection) in a content type called 'watches'. Those fields are,
field_water_resistance -> water_resistance(Term Reference)
field_gender ...
0
votes
1
answer
76
views
Update user profile picture using entity_metadata_wrapper
I am trying to update the user profile picture using entity_metadata_wrapper. But I am getting
"Unknown data property picture." error.
When I check the user property info, I cant see the ...
0
votes
1
answer
54
views
How to create a node with mulitple field-collection items?
I've a content type having filed collection item (3 fields of 5 sets). Created a custom module form, when user submits that form, it should create a node with all 5 set field collection items.
So far ...
-1
votes
3
answers
1k
views
How to get the length of a field collection array [closed]
I'm using Drupal 7 and want to get the length of the field collection array. How can I get it? Can someone provide the code snippet for that?
This is the code that prints the table.
<!DOCTYPE ...
0
votes
1
answer
131
views
how to get values from two content types using one entity reference
I'm using Drupal 7 and have 3 content types -
Product
Purchase
Sales
In sales content type, I'm using entity reference I want to fetch and display "product name" from Product content type and "...