When I enable translation for a content type. And then create a node of that type and then when I edit that node, I see the following notice on my site.
Notice: Undefined variable: source_langcode in Drupal\content_translation\ContentTranslationHandler->entityFormAlter() (line 415 of core/modules/content_translation/src/ContentTranslationHandler.php).
Drupal\content_translation\ContentTranslationHandler->entityFormAlter(Array, Object, Object) (Line: 18)
Drupal\node\NodeTranslationHandler->entityFormAlter(Array, Object, Object) (Line: 400)
content_translation_form_alter(Array, Object, 'node_living_unit_edit_form') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'node_living_unit_edit_form') (Line: 836)
Drupal\Core\Form\FormBuilder->prepareForm('node_living_unit_edit_form', Array, Object) (Line: 418)
Drupal\Core\Form\FormBuilder->rebuildForm('node_living_unit_edit_form', Object, Array) (Line: 627)
Drupal\Core\Form\FormBuilder->processForm('node_living_unit_edit_form', Array, Object) (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 694)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I updated the Drupal core using composer from 8.8.0 with the following steps
composer update drupal/core:^8.8.1 --with-dependencies
Comments
Comment #2
knyshuk.vova commentedTagging for Drupal Global Contribution Weekend
Comment #3
hmdnawaz commentedIs there any solution for this issue?
Comment #4
knyshuk.vova commentedhmdnawaz,
we have a plan to work with it on 25th of January.
Could you please add more steps with more details about how to reproduce the issue, if you have the same issue on your side? It will be helpful for further developers to reproduce and fix it.
Comment #5
hmdnawaz commentedSteps to reproduce
Created a content type. Enabled the translation for that content type

Created a node of that content type.
Went to node/[nid]/edit
Clicked on the translation tab.
Then clicked
Addfor another language and the following error displaysNotice: Undefined variable: source_langcode in /var/www/web/core/modules/content_translation/src/ContentTranslationHandler.php on line 437Added the translation and saved the node.
Then I open the node to edit in default language /en/node/[nid]/edit. On the form I can see that error again.
Notice: Undefined variable: source_langcode in /var/www/web/core/modules/content_translation/src/ContentTranslationHandler.php on line 437In my case this condition does not becomes true.
on line 346 on
ContentTranslationHandler.phpand the source_langcode variable is defined inside that condition that is why I am getting the error.
Comment #6
yugro commentedComment #7
yugro commentedI have installed drupal 8.8.1 and enabled translation for basic page. There is no warning while editing newly created node.
Can you please give more details to reproduce that notice?
Comment #8
yugro commentedComment #9
hmdnawaz commentedThen Why I am getting this error? Is there any config which is missed on site and I have to re-import that config? Can someone help me on that?
Comment #10
monymirza