This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Content Entity Type - entity collection route not created

Hi All

I am creating new Content Entity Type called product (in latest Drupal version 9.4.2).

I have created entity plugin and added annotation (below I include sections needed to create entity routes):

in handler section i have:

"route_provider" = {

* "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",

* },

admin permissions:

admin_permission = "administer contact entity",

in the links:

* links = {

Call entity

Hi sorry for the question but im new and im starting to undertand abou entities but is still hard for me. IM not sure about how to call the entities.

Here i didnt have a problem tu get the number.

$price= \Drupal::entityTypeManager()->getStorage('commerce_order_item')->load($id)->get('unit_price')->getValue()[0]['number'];

But here i dont undertand why i could not take a percentage y try to many combinations. Maybe some one can show me the proper way to write this.

Getting appropriate response from drupal page variant API

Hi,

So, I have been trying to get the desired response from the below two apis but haven't found an efficient way to call (chain the two apis).

What i do i, I call the first API (/page_variant) to get a set of block id and then use that id to call the second api, as shown below -

Bundle classes with custom content entity

The new bundle classes introduced in 9.3 look great!  I've got a use case that calls for that exact model, where we have a base content type with fields that will be common to all instances, extended by bundle classes that provide additional fields for specific content types.  So, I've got a custom content entity and a couple of bundle classes to go along with it, all generated in drush 11, and I've registered my bundles in hook_entity_bundle_info()

Unable to download Color Backport Module to replace the Core module being deprecated

Hi,

Following an announcement advising that the Core module "Color" will be deprecated, I'm trying to install the replacement: Color Backport but I receive the following error:

Could not find package drupal/color-color

Steps:

  1. I uninstalled the core module using the web interface - Now the module is not checked
  2. I run $ composer require 'drupal/color-color:^1.0'

What could be the problem?

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions