Seems sometimes $sub_build['title'] is set, but not $sub_build['title']['source'] and it is generating warning message.

CommentFileSizeAuthor
#3 2020961-source-warning-3.patch1.35 KBvijaycs85
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vijaycs85’s picture

Seems somewhere schema missing title... however fixing the condition like below would fix the warning.

diff --git a/lib/Drupal/config_translation/Form/ConfigTranslationManageForm.php b/lib/Drupal/config_translation/Form/ConfigTranslationManageForm.php
index 4627a1c..d8ba3f1 100644
--- a/lib/Drupal/config_translation/Form/ConfigTranslationManageForm.php
+++ b/lib/Drupal/config_translation/Form/ConfigTranslationManageForm.php
@@ -169,15 +169,15 @@ class ConfigTranslationManageForm implements FormInterface {
           // check if there is an element which is called title or label, then
           // check if there is an element which contains these words.
           $title = '';
-          if (isset($sub_build['title'])) {
+          if (isset($sub_build['title']['source'])) {
             $title = $sub_build['title']['source']['#markup'];
           }
-          elseif (isset($sub_build['label'])) {
+          elseif (isset($sub_build['label']['source'])) {
             $title = $sub_build['label']['source']['#markup'];
           }
           else {
             foreach (array_keys($sub_build) as $title_key) {
-              if (strpos($title_key, 'title') !== FALSE || strpos($title_key, 'label') !== FALSE) {
+              if (isset($sub_build[$title_key]['source']) && (strpos($title_key, 'title') !== FALSE || strpos($title_key, 'label') !== FALSE)) {
                 $title = $sub_build[$title_key]['source']['#markup'];
                 break;
               }

But not sure it is the good thing to do... will check with @gabor.

Gábor Hojtsy’s picture

Status: Active » Needs work

Looks like a reasonable fix. We'll never be able to ensure all schemas have titles everywhere. Needed in patch form :)

vijaycs85’s picture

Status: Needs work » Needs review
FileSize
1.35 KB

Here is the patch...

Gábor Hojtsy’s picture

Status: Needs review » Fixed

Superb, committed.

Status: Fixed » Closed (fixed)

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