@@ -335,21 +335,21 @@ protected function parseAuthorIds($feedData, $fieldInfo): ?array
335335 if ($ element ) {
336336 $ matchedIds [] = $ element ->id ;
337337 }
338- }
339338
340- // Check if we should create the element. But only if email is provided (for the moment)
341- if ($ create && $ match === 'email ' ) {
342- $ element = new UserElement ();
343- $ element ->username = $ value ;
344- $ element ->email = $ value ;
339+ // Check if we should create the element. But only if email is provided (for the moment)
340+ if ($ create && $ match === 'email ' ) {
341+ $ element = new UserElement ();
342+ $ element ->username = $ value ;
343+ $ element ->email = $ value ;
345344
346- if (!Craft::$ app ->getElements ()->saveElement ($ element , true , true , Hash::get ($ this ->feed , 'updateSearchIndexes ' ))) {
347- Plugin::error ('Entry error: Could not create author - `{e}`. ' , ['e ' => Json::encode ($ element ->getErrors ())]);
348- } else {
349- Plugin::info ('Author `#{id}` added. ' , ['id ' => $ element ->id ]);
350- }
345+ if (!Craft::$ app ->getElements ()->saveElement ($ element , true , true , Hash::get ($ this ->feed , 'updateSearchIndexes ' ))) {
346+ Plugin::error ('Entry error: Could not create author - `{e}`. ' , ['e ' => Json::encode ($ element ->getErrors ())]);
347+ } else {
348+ Plugin::info ('Author `#{id}` added. ' , ['id ' => $ element ->id ]);
349+ }
351350
352- $ matchedIds [] = $ element ->id ;
351+ $ matchedIds [] = $ element ->id ;
352+ }
353353 }
354354
355355 return $ matchedIds ;
0 commit comments