Problem/Motivation

Since #2256679: Use config schema to determine which config entity properties to export regardless of whether they are public or protected we no longer are using public properties to determine what to export. This makes we can make the properties protected. This is a good thing since using public properties makes for a bad API.

Proposed resolution

Protected the properties and fix any code that assumes they are public.

Remaining tasks

Write patch

User interface changes

none

API changes

none

Comments

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new1.4 KB

Let's see what breaks.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new3.01 KB
new1.61 KB

No idea why we have that status handling. If a config entity wants status, they specify a key. They all currently use 'status', which defaults to TRUE.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new8.55 KB
new11.56 KB
tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new21.96 KB

Added this to ConfigEntityBase help debug tests:

+ function __get($name) {
+ throw new \Exception($name);
+ }

tim.plunkett’s picture

Assigned: Unassigned » tim.plunkett
tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new26.57 KB

Okay, took this into a testing issue, this should pass (without the __get hack).

tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned
berdir’s picture

  1. +++ b/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php
    @@ -1589,7 +1589,7 @@ static protected function _generateFieldTableName(FieldConfigInterface $field, $
           $entity_type = substr($field->entity_type, 0, 34);
    -      $field_hash = substr(hash('sha256', $field->uuid), 0, 10);
    +      $field_hash = substr(hash('sha256', $field->uuid()), 0, 10);
           $table_name = $entity_type . $separator . $field_hash;
         }
    

    This overlaps with #2144263: Decouple entity field storage from configurable fields, which will introduce a new method for this (as it also needs to work for non-entity field definitions there)

  2. +++ b/core/modules/block/src/BlockViewBuilder.php
    @@ -85,7 +85,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la
               $entity->id(),
    -          $entity->langcode,
    +          $entity->get('langcode'),
    

    This is usually done as language()->id, we need a langcode() method.. :)

alexpott’s picture

StatusFileSize
new9.88 KB
new27.95 KB

Re @Berdir's #2 - how about using $entity->language()->getId()

Patch also changes a couple of copies of the $status property to protected.

Status: Needs review » Needs work

The last submitted patch, 13: 2286681.13.patch, failed testing.

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new2.25 KB
new29.7 KB

So #1936216: Configuration language selectors should have English even if English is not on the site means that Config Entities should be able to be in English even if the site does not have english enabled. This is interesting since Entity::language() means that we can end up in situations where $entity->language()->getId() != $entity->langcode.

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 15: 2286681.15.patch, failed testing.

alexpott’s picture

Status: Needs work » Needs review

15: 2286681.15.patch queued for re-testing.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

#17 was a head fail and a rtbc queue retest... so back to rtbc.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

  • webchick committed 5cd540a on 8.x
    Issue #2286681 by alexpott, tim.plunkett: Fixed Make public properties...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.