@@ -51,11 +51,6 @@ private function retrieveObjects($references)
5151 $ with = $ content_type_model ->activityLazyLoading ;
5252 }
5353 $ fetched = $ this ->fromDb ($ content_type_model , array_keys ($ content_ids ), $ with );
54- if (count ($ fetched ) < count (array_keys ($ content_ids ))) {
55- $ missing_ids = array_values (array_diff (array_keys ($ content_ids ), array_keys ($ fetched )));
56- $ pretty_ids = var_export ($ missing_ids , true );
57- throw new MissingDataException ("Some data in this feed is not in the database: model: {$ content_type } ids: {$ pretty_ids }" );
58- }
5954 $ objects [$ content_type ] = $ fetched ;
6055 }
6156 return $ objects ;
@@ -74,16 +69,18 @@ private function injectObjects(&$activities, $objects)
7469 {
7570 foreach ($ activities as $ key => $ activity ) {
7671 foreach ($ this ->fields as $ field ) {
77- if (!array_key_exists ( $ field , $ activity ))
72+ if (!isset ( $ activity[ $ field ] ))
7873 continue ;
7974 $ value = $ activity [$ field ];
8075 $ reference = explode (': ' , $ value );
81- if (!array_key_exists ($ reference [0 ], $ objects ))
76+ if (!array_key_exists ($ reference [0 ], $ objects )) {
8277 $ activity ->trackNotEnrichedField ($ reference [0 ], $ reference [1 ]);
8378 continue ;
84- if (!array_key_exists ($ reference [1 ], $ objects [$ reference [0 ]]))
79+ }
80+ if (!array_key_exists ($ reference [1 ], $ objects [$ reference [0 ]])) {
8581 $ activity ->trackNotEnrichedField ($ reference [0 ], $ reference [1 ]);
8682 continue ;
83+ }
8784 $ activities [$ key ][$ field ] = $ objects [$ reference [0 ]][$ reference [1 ]];
8885 }
8986 }
0 commit comments