Problem/Motivation

Extending config translation is hard without having access to the entity itself.

Proposed resolution

Expose the entity through a getter.

Remaining tasks

Discuss if acceptable,
Patch,
Reviews

User interface changes

None.

API changes

API addition. getEntity in ConfigEntityMapper.

Data model changes

None.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task
Issue priority Major because is blocking other usability bugs like #2546212: [PP-1] Entity view/form mode formatter/widget settings have no translation UI
Prioritized changes The main goal of this issue is usability for other issues by adding just new getter for ConfigEntityMapper
Files: 
CommentFileSizeAuthor
#4 2565031-configentitymapper-4.patch2.13 KBpenyaskito
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 113,980 pass(es). View
#4 2565031-configentitymapper.interdiff.2-4.txt2.17 KBpenyaskito

Comments

penyaskito created an issue. See original summary.

penyaskito’s picture

Status: Active » Needs review
FileSize
2.02 KB
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 111,828 pass(es). View

Implemented getter + test.

vijaycs85’s picture

Nice one @penyaskito.

  1. +++ b/core/modules/config_translation/src/ConfigEntityMapper.php
    @@ -117,6 +117,16 @@ public function populateFromRequest(Request $request) {
    +  public function getEntity() {
    

    Funny, we have set, but no get.

  2. +++ b/core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php
    @@ -99,6 +99,31 @@ protected function setUp() {
    +   * Tests ConfigEntityMapper::getOperations().
    

    Needs updated comment.

  3. +++ b/core/modules/config_translation/tests/src/Unit/ConfigEntityMapperTest.php
    @@ -99,6 +99,31 @@ protected function setUp() {
    +  public function testGetEntity() {
    

    Also, thinking it's worth renaming the testSetEntity to accommodate get as well? Because most of the code seems common.

penyaskito’s picture

FileSize
2.17 KB
2.13 KB
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 113,980 pass(es). View

You are right, let's test both in the same test.

vijaycs85’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, 4: 2565031-configentitymapper-4.patch, failed testing.

Status: Needs work » Needs review
penyaskito’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC, the error was unrelated.

penyaskito’s picture

Issue tags: +Quick fix
penyaskito’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs beta evaluation, +Novice

@alexpott asked for a good beta evaluation if we want this considered for 8.0.0

tstoeckler’s picture

#2546212: [PP-1] Entity view/form mode formatter/widget settings have no translation UI will probably end up needing this. This is really an oversight, would be great to get this in.

rodrigoaguilera’s picture

Issue summary: View changes
Priority: Normal » Major
Status: Needs work » Reviewed & tested by the community

Added the beta evaluation and raised the priority.
I'm not sure if it can be back to RTBC but let's be bold.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

I'm committing this under the maintainer discretion provision in the beta policy since it will enable contrib and has zero disruption. Committed 068f6ad and pushed to 8.0.x. Thanks!

  • alexpott committed 068f6ad on
    Issue #2565031 by penyaskito: Expose $entity in ConfigEntityMapper
    
Gábor Hojtsy’s picture

Issue tags: -sprint

Yay!

Status: Fixed » Closed (fixed)

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