Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have added weight field as base field in my custom entity type.
When I create view for this entity type, only original weight field is available in view fields list and selector view field is missing.
Please note that Im facing this problem only in case of base field. Im also using weight field with media entity bundles, but there it works perfectly.
Is the custom entity type support missing from weight module or I am missing something else?
Comment | File | Size | Author |
---|---|---|---|
#9 | langcode-13324743.patch | 535 bytes | lobodakyrylo |
|
Comments
Comment #2
tahirmus CreditAttribution: tahirmus commentedComment #3
tahirmus CreditAttribution: tahirmus commentedComment #4
ziomizar CreditAttribution: ziomizar at Station, East Atlantic Engineering commentedHi tahirmus,
I've tried it quickly using eck and it seems work correctly, with the latest dev version and drupal 8.6.1.
Did you still have the issue?
Comment #5
ziomizar CreditAttribution: ziomizar at Station, East Atlantic Engineering commentedComment #6
ziomizar CreditAttribution: ziomizar at Station, East Atlantic Engineering commentedComment #7
ziomizar CreditAttribution: ziomizar at Station, East Atlantic Engineering commentedComment #8
lobodakyrylo CreditAttribution: lobodakyrylo as a volunteer commentedI also tried to create custom entity with weight field. My code looks like this:
This code doesn't define field storage so the Weight Selector field isn't shown in Views.
I found a solution but it works just for me:
This code overrides data for my entity. I think weight_field_views_data should be rewritten to cover fields without storage.
Comment #9
lobodakyrylo CreditAttribution: lobodakyrylo as a volunteer commentedAlso, I noticed that not all entities could have langcode field and it could generate this error:
Notice: Undefined property: Drupal\views\ResultRow::$customizer_style__weight_langcode in Drupal\weight\Plugin\views\field\WeightSelector->viewsForm() (line 89 of modules/contrib/weight/src/Plugin/views/field/WeightSelector.php).
This is a patch for solving this issue
Comment #10
ziomizar CreditAttribution: ziomizar commentedset to "Need review" to run automatic tests
Comment #12
ziomizar CreditAttribution: ziomizar commentedThanks for spotting the error in #9 this has been commited to dev,
The issue still open as the patch don't solve the problem in the IS.
Comment #13
Rithesh BK CreditAttribution: Rithesh BK as a volunteer and at Valuebound for Valuebound commentedcurrently i am working on that ......
Comment #14
Rithesh BK CreditAttribution: Rithesh BK as a volunteer and at Valuebound for Valuebound commented