File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,10 +60,30 @@ public function send() {
6060 $ entity = \Drupal::entityTypeManager ()->getStorage ('node ' )->loadRevision ($ this ->vid );
6161 }
6262
63+ if (!$ entity ) {
64+ \Drupal::logger ('quant_seed ' )->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+
6374 foreach ($ entity ->getTranslationLanguages () as $ langcode => $ language ) {
6475 if (!empty ($ this ->filter ) && !in_array ($ langcode , $ this ->filter )) {
6576 continue ;
6677 }
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+
6787 Seed::seedNode ($ entity , $ langcode );
6888 }
6989 }
Original file line number Diff line number Diff line change @@ -212,6 +212,10 @@ public static function unpublishRedirect($redirect) {
212212 * Seeds taxonomy term.
213213 */
214214 public static function seedTaxonomyTerm ($ entity , $ langcode = NULL ) {
215+
216+ // Use the translation to ensure correct metadata such as published state.
217+ $ entity = $ entity ->getTranslation ($ langcode );
218+
215219 $ tid = $ entity ->get ('tid ' )->value ;
216220
217221 $ url = Utility::getCanonicalUrl ('taxonomy_term ' , $ tid , $ langcode );
@@ -264,6 +268,9 @@ public static function seedTaxonomyTerm($entity, $langcode = NULL) {
264268 */
265269 public static function seedNode (EntityInterface $ entity , $ langcode = NULL ) {
266270
271+ // Use the translation to ensure correct metadata such as published state.
272+ $ entity = $ entity ->getTranslation ($ langcode );
273+
267274 $ nid = $ entity ->get ('nid ' )->value ;
268275 $ rid = $ entity ->get ('vid ' )->value ;
269276
You can’t perform that action at this time.
0 commit comments