File tree 2 files changed +27
-3
lines changed
2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,8 @@ function quant_cron_cron() {
70
70
if (!empty($filter) && !in_array($langcode, $filter)) {
71
71
continue;
72
72
}
73
- Seed::seedNode($entity, $langcode);
73
+ $translated_entity = $entity->getTranslation($langcode);
74
+ Seed::seedNode($translated_entity, $langcode);
74
75
75
76
\Drupal::logger('quant_cron')->notice("quant_cron sending node: nid: @nid, langcode: @lang",
76
77
[
@@ -92,7 +93,8 @@ function quant_cron_cron() {
92
93
$term = Term::load($tid);
93
94
94
95
foreach ($term->getTranslationLanguages() as $langcode => $language) {
95
- Seed::seedTaxonomyTerm($term, $langcode);
96
+ $translated_term = $term->getTranslation($langcode);
97
+ Seed::seedTaxonomyTerm($translated_term, $langcode);
96
98
97
99
\Drupal::logger('quant_cron')->notice("quant_cron sending term: tid: @tid, langcode: @lang",
98
100
[
Original file line number Diff line number Diff line change @@ -60,11 +60,33 @@ public function send() {
60
60
$ entity = \Drupal::entityTypeManager ()->getStorage ('node ' )->loadRevision ($ this ->vid );
61
61
}
62
62
63
+ if (!$ entity ) {
64
+ \Drupal::logger ('quant ' )->error (
65
+ 'Failed to load entity for node ID: @id, revision ID: @vid ' ,
66
+ [
67
+ '@id ' => $ this ->id ,
68
+ '@vid ' => $ this ->vid ,
69
+ ]
70
+ );
71
+ return ;
72
+ }
73
+
63
74
foreach ($ entity ->getTranslationLanguages () as $ langcode => $ language ) {
64
75
if (!empty ($ this ->filter ) && !in_array ($ langcode , $ this ->filter )) {
65
76
continue ;
66
77
}
67
- Seed::seedNode ($ entity , $ langcode );
78
+
79
+ \Drupal::logger ('quant_seed ' )->notice (
80
+ 'Processing language @langcode for node @id ' ,
81
+ [
82
+ '@langcode ' => $ langcode ,
83
+ '@id ' => $ this ->id ,
84
+ ]
85
+ );
86
+
87
+ // getTranslation provides more accurate published status.
88
+ $ translated_entity = $ entity ->getTranslation ($ langcode );
89
+ Seed::seedNode ($ translated_entity , $ langcode );
68
90
}
69
91
}
70
92
You can’t perform that action at this time.
0 commit comments