‘Edit Own Content’ permission missing in custom entity

‘Edit Own Content’ permission missing in custom entity

I have generated a custom entity using Drupal Console. drupal generate:entity:content The entity doesn’t have the permission edit own content which we usually have in node types etc… The entities entity_name.permissions.yml the file has the following... read more
‘Edit Own Content’ permission missing in custom entity

Add Field to Custom Content Type Programatically

I’m trying to create a module that creates its own content types during installation. I understand that I need to use the Configuration API and the Entity API, but I’m having trouble adding Drupal-included fields to my custom type. From what I understand,... read more
‘Edit Own Content’ permission missing in custom entity

How do I add Custom fields to the Order Information Checkout page in Commerce 2?

I would like to add a set of additional fields to the order summary so after a user adds a product they would need to fill out some conditional fields of information alongside their billing information. Drupal Commerce 2 documentation is pretty lacking at the moment... read more
‘Edit Own Content’ permission missing in custom entity

Product migration with group and execute-dependencies options

I’m migrating from an SQL source in a D8 commerce site. Presently, I’m working on product and inventory data. I have one migration for product variations, one for products, and then 6 additional migrations for inventory tables all in a single migration... read more
‘Edit Own Content’ permission missing in custom entity

Is there a way to show all routes used? [closed]

I want to get a list (dump) of used routes. read more
‘Edit Own Content’ permission missing in custom entity

Adding custom field while migrating

I am trying to merging content types while migrating to drupal 8 from drupal 7 and at the same time differentiating them with the taxonomy terms in D8. E.g. The content types from D7 i.e. Article, Page, Blog will merge to a content types called “Media” in... read more
‘Edit Own Content’ permission missing in custom entity

Computed field value in twig template

I use a computed field, to calculate and store a floating value for a node. Now I want to work with this value in a twig template. When I access the field value via {{ content.computed_field.0 }}it outputs the correct value, say 0.22. When I try to calculate with this... read more
‘Edit Own Content’ permission missing in custom entity

How to use dd(debug_backtrace()); for an error debugging?

I have this exact error on my site. I am trying to troubleshoot the error using dd(debug_backtrace()); through the Devel module as is described on the link above. Being the noob on developing I can’t figure out how to print the output in a drupal_debug.txt file... read more
‘Edit Own Content’ permission missing in custom entity

Programmatically adding line items to Ubercart order

Can someone please suggest how do we add line items to an Ubercart order in Drupal 8? When I look at the references in Ubercart module, I get this: // Load line items… has to be last after everything has been loaded. $order->line_items =... read more
‘Edit Own Content’ permission missing in custom entity

How do i force a text format and hide the format selector in a formatted text field?

I Want to force a certain text format in a user profile text format field and hide the text format selector dropdown. How do i do it? This is for Drupal 8. read more
‘Edit Own Content’ permission missing in custom entity

How do I fetch the ID from the URL?

I have a view which has 2 displays i.e ‘page’ and ‘attachment’. I am trying to fetch the id from the url and want to display it on ‘attachment’ display but having difficulty. On the ‘attachment’ display, I want to... read more
‘Edit Own Content’ permission missing in custom entity

Fetch Link field Label and Link separately in views-view-fields template

How can I fetch label and link field in views-view-fields–VIEW-NAME-HERE.html.twig file So far I have tried {{ fields.field_action_link.content }} give me the anchor tag prebuilt (html) {{ fields.field_action_link.0.url }} {{... read more
‘Edit Own Content’ permission missing in custom entity

Checkboxes in a simple form are not displayed

I have a simple form in a custom module that works well and is displaying my select as it should. $form = Drupal::formBuilder()->getForm(‘DrupalefqFormFilterForm’); $form[“container”] = array( ‘categories’ => array(... read more
‘Edit Own Content’ permission missing in custom entity

Programmatically generate orders

I am trying to programmatically generate orders in Drupal 8. $order = Order::create(array( ‘uid’ => $uid, ‘order_status’ => uc_order_state_default(‘in_checkout’), )); $order->save(); $product =... read more
‘Edit Own Content’ permission missing in custom entity

Warning: Invalid argument supplied for foreach() in form_select_options() (line 2837 of includes/form.inc)

I get the following erros on selecting the selectbox. Here onchang of this field will populate another checkbox with city details id zipcode using ajax callback. $zipcode_options = get_all_zipcodes_ascending(); // Populate Ort on auktion clone. $selected =... read more
‘Edit Own Content’ permission missing in custom entity

Inline entity form ajax

I am trying to update some field options in an inline entity form with ajax. This should happen, when someone selects a value in an other field. I already have some code which “works”, but the problem is that you can edit multiple items and there seems to... read more
‘Edit Own Content’ permission missing in custom entity

how to use an entity query to make a sortable table

I need to use an entity query such as this: $query = Drupal::entityQuery(‘node’) ->condition(‘type’, ‘blog_post’) ->sort(‘field’); $nids = $query->execute(); to make a table that is sortable in a custom module .... read more
‘Edit Own Content’ permission missing in custom entity

Why are two database tables (node and node_field_data) used for node data?

I would like to understand the database architecture of Drupal 8. I noticed that Drupal 8 has two separate tables (node and node_field_data) which include almost the same columns. Can anyone give some clarification on this? read more
‘Edit Own Content’ permission missing in custom entity

Views archive page showing year and months of article content type

I am trying to build a view page that shows archives (content type is article) only by dates: year (e.g.2016) february (post count) june (post count) etc .. year (e.g. 2017) march (post count) june (post count) To top it off, months being linked to the respective... read more
‘Edit Own Content’ permission missing in custom entity

Get form values in hook_user_insert()

How can I get form values like first name, last name, email and password in hook_user_insert() in Drupal 8? read more