35 questions
0
votes
1
answer
849
views
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 ...
1
vote
1
answer
275
views
Drupal 9 - Allow access to a page only from a specific domain
How to allow access to a Drupal file/page only from a specific domain?
I have tried php filter module but enabling this module can cause security and performance issues as it allows users to execute ...
0
votes
0
answers
188
views
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:
...
1
vote
1
answer
874
views
D8 PHP: Updating "Text (plain)" field value on node entity via set() and save() ignored when value changes from "1" to "01"
Goal: Programmatically change value of string field from "1" to "01" using entity ->set() and ->save()
When attempting to update a field on a node programmatically (via a custom module's cron hook), ...
0
votes
1
answer
136
views
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 ...
2
votes
1
answer
4k
views
Query Paragraph Type in Drupal 8
I am trying to Query all paragraphs of a certain type but I am not getting any output. Is my query right? Currently being returned an empty array.
$query = $this->node->getQuery()
-&...
0
votes
1
answer
441
views
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. ...
8
votes
3
answers
17k
views
How to update or create paragraph fields programatically in drupal8
Below is my solution with an example, that may help you.
Update existing field
$target_id = 62;
$paragraph = Paragraph::load($target_id);
$typeform_field = $paragraph->field_archtics_field->...
0
votes
1
answer
2k
views
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, ...
0
votes
1
answer
659
views
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 ...
0
votes
0
answers
52
views
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.
1
vote
1
answer
4k
views
Drupal 8 Image Field value
I'm trying to figure out how to get the path to an image from an entity in Drupal 8. I had thought get()->value would do it, but that just returns a blank string.
I have a test function:
function ...
0
votes
1
answer
57
views
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['...
1
vote
4
answers
2k
views
Add a field from a node into page.tpl.php, drupal 7
Creating a sub-theme in Drupal 7's page.tpl.php and needing to pull the value (plain text) from field_EXAMPLE from a custom content type outside of where the rest of the content would normal be.
<!...
0
votes
1
answer
182
views
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). ...
0
votes
1
answer
63
views
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
162
views
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 ...
1
vote
1
answer
308
views
How to remove default fields a content entity
I was under the impression that by removing fields from public static function baseFieldDefinitions that they would not be required anymore during trying to save the entity. My function now only ...
2
votes
0
answers
572
views
Create database fields to an existing table when installing a module in Drupal 8
I'm new to drupal and I need some help.
I created a new module with name user_extra. Which create necessery table when Installing the module.
But I also need to insert some database field in '...
0
votes
1
answer
564
views
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 ...
0
votes
1
answer
2k
views
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 ...
0
votes
0
answers
33
views
Relating content in drupal
Need a drupal help.
I have two content types, works and clients.
When I'm adding a new work I'd like to include the client which the work was for, so I can display the client´s logo on the work ...
2
votes
1
answer
2k
views
How do I get the node/entity from an instance of entity_metadata_wrapper in Drupal 7?
How do I get a reference to the node/entity used to instantiate entity_metadata_wrapper / EntityDrupalWrapper. I could not find a getNode/getEntity or similar method in the
EntityDrupalWrapper API ...
2
votes
0
answers
640
views
Drupal Entity API and Views bulk operations - "Modify entity values" action provides empty form
I created new entity, some sample entities and views using VBO table. "Delete" VBO action works well, but "Modify entity values" provides an empty form with "Next" button and "Cancel" link only. If I ...
0
votes
1
answer
2k
views
How can I programmatically create a select input whose values come from a foreign key using Form API?
I have Table A who has a foreign key referring to Table B. I want my form associated with Table A to have a select field whose values will come from Table B. I want the select field to have options ...
0
votes
2
answers
2k
views
Drupal 7: Taxonomies or Relations? what's a good why to strcuture hierarchial content
I'm a total Drupal Newbie, trying to understand the basic concepts of building hierarchical content.
Let's say I'm building a website for a Music Label and want to represent this structure, should I ...
0
votes
1
answer
971
views
Drupal 7: Hooks for entity references
Is it possible to hook on changes of entity references?
Let's say I have a <- b and b <- x -> a.
when a <- b changes to d <- b I want also b <- x -> a to change to b <- x -> ...
0
votes
1
answer
1k
views
Field Collection Output: Undefined index: entity in template_field__custom_field drupal 7
perhaps you have an idea how I can solve the following problem. I rewrite a field-collection-field in my template.php to change the output. Therefore I just added a new var ($my_classes) which ...
0
votes
1
answer
1k
views
attach image_field to entity in drupal 7
I use drupal 7, and Entity API to develope a module. I have an entity to record client information. I wish to use image_field to let client upload their logo. So I have this function:
function ...
1
vote
1
answer
231
views
Drupal 7: How to get this value with PHP
Please see the attached image below. I need to get the highlighted value via PHP and put it into one of my templates. I'm not exactly sure how this works, but this text is created as part of an ...
2
votes
2
answers
4k
views
Drupal 7 entityforms module: How to get value of a field with php?
I am using the entityform module to capture some user submitted data http://drupal.org/project/entityform
I need to pull in some of the entity field values into one of my templates. I was trying to ...
0
votes
1
answer
973
views
Use of entity_extract_ids($entity_type, $entity)
I am trying to use entity_extract_ids($entity_type, $entity) where:
$entity_type = The entity type; e.g. 'node' or 'user'.
$entity = The entity from which to extract values.
I have never used this ...
1
vote
2
answers
11k
views
Getting Entity Malformed Exception error while adding a taxonomy term in drupal7
I'm using Drupal7. When i'm adding a new term in a taxonomy vocabulary getting the following
error.
"Entity Malformed excetion : Missing bundle property on entity of type node.in entity_extract_ids()...
1
vote
1
answer
175
views
Display a list of type group
I have read the tutorial, and the API, looked through the code examples.
But when it came down to implementation, it didn't work as i thought it would.
I am trying to avoid using the Views module for ...
2
votes
1
answer
3k
views
Entity method loading twice
Lately I've been building a Drupal 7 module with the Entity API but I've run in to a problem. When debugging an edit form I've noticed that the load method is called twice which is causing an error.
...