Problem/Motivation

When an item is in the progress of being translated, there is an 'in progress' link on /admin/tmgmt/items/17?destination=node/6/translations which leads to a fatal error when you click on it.
( ! ) Fatal error: Call to a member function getPluginId() on a non-object in /usr/local/var/www/d8/www/modules/tmgmt/src/Form/JobItemForm.php on line 430

Steps to reproduce:

  • make sure there iis no translator available for translating
  • request translation for a node
  • go back
  • click on "In progress"

Proposed resolution

Fix the issue, provide patch, review it and then commit it.

Remaining tasks

All of them.

User interface changes

'
None

API changes

None

Comments

juanse254’s picture

Status: Active » Needs review
StatusFileSize
new4.44 KB

Fixed a couple syntax issues as well as the fix for the issue. Hard to recreate.

miro_dietiker’s picture

This is a more general followup to investigate one of the roots of the problem #2538360: Verify stability with existing jobs when deleting a translator

juanse254’s picture

Added tests on this.

juanse254’s picture

StatusFileSize
new5.77 KB

Ups and ill have a look at that.

miro_dietiker’s picture

Status: Needs review » Needs work

Please pass a patch only containing relevant changes.
We don't apply code style fixes mixed with functional changes.
Also it makes reviewing very hard.

We can have a separate task if you want to propose code cleanup.. But make sure to find a proper moment when it does not clash with too many issues with patches. We don't commit cosmetic fixes if it breaks active work.

juanse254’s picture

Status: Needs work » Needs review
StatusFileSize
new2.99 KB
new2.96 KB

okay, im uploading the patch with the functional changes only.

sasanikolic’s picture

sasanikolic’s picture

Title: Clicking 'in progress' on Job Item overview leads to fatal error » Fatal error when clicking 'in progress' without translators
sasanikolic’s picture

Title: Fatal error when clicking 'in progress' without translators » Fatal error when clicking 'in progress' without a translator
sasanikolic’s picture

Issue summary: View changes
sasanikolic’s picture

Status: Needs review » Needs work
+++ b/src/Form/JobItemForm.php
@@ -423,13 +423,16 @@ class JobItemForm extends TmgmtFormBase {
-

Irrelevant change.

sasanikolic’s picture

+++ b/src/Form/JobItemForm.php
@@ -423,13 +423,16 @@ class JobItemForm extends TmgmtFormBase {
         // Give the translator ui controller a chance to affect the data item element.

Forgot this... The comment is longer than 80 characters.

juanse254’s picture

Status: Needs work » Needs review
StatusFileSize
new2.88 KB
new484 bytes

Okay, uploaded interdiff as well.

juanse254’s picture

12.- thats a separate change, nothing to do with this issue nor added by me. As stated before we need to clean the whole class, also the comment above in the class is over 80 chars.

mbovan’s picture

Status: Needs review » Needs work
  1. +++ b/sources/content/src/Tests/ContentEntitySourceUiTest.php
    @@ -107,6 +107,20 @@ class ContentEntitySourceUiTest extends EntityTestBase {
    +    $this->clickLink('Translate');
    
  2. Maybe not for assetText(), but I'm pretty sure that we should have t() for links/buttons.

  3. +++ b/src/Form/JobItemForm.php
    @@ -425,11 +425,15 @@ class JobItemForm extends TmgmtFormBase {
    +            ->createUiInstance($job_item->getTranslator()->getPluginId())
    

    The method name is createUIInstance().

juanse254’s picture

Status: Needs work » Needs review
StatusFileSize
new2.88 KB
new1.28 KB

Both fixed, none of them are related to my issue they were there before so i would suggest to clean up the class, since there are lots of other things like this.

berdir’s picture

Category: Task » Bug report
Status: Needs review » Needs work

This looks good.

When working on a bugfix (and this is, so it is not a task :)), always provide a test-only patch as the first file, which is supposed to fail. That makes it easy for reviewers to see that the test is in fact covering the broken scenario and fails without the fix.

juanse254’s picture

Status: Needs work » Needs review
StatusFileSize
new1.33 KB

Done.

Status: Needs review » Needs work

The last submitted patch, 18: Clicking_in_progress-2504639-16_TEST-ONLY.patch, failed testing.

juanse254’s picture

Status: Needs work » Needs review
LKS90’s picture

Status: Needs review » Reviewed & tested by the community

Looking good, TEST ONLY fails at the expected position. The issue seems fixed and test covered.

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

  • Berdir committed 5d35aa2 on 8.x-1.x authored by juanse254
    Issue #2504639 by juanse254: Fatal error when clicking 'in progress'...

Status: Fixed » Closed (fixed)

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