@@ -203,7 +203,7 @@ private function prepareSelect(Select $select): Select
203203 // check if the table has not been overridden for backward compatibility
204204 if ($ this ->getMainTable () === $ this ->getTable ('importexport_importdata ' )) {
205205 // user_id is NULL part is for backward compatibility
206- $ select ->where ('user_id=? OR user_id is NULL ' , $ this ->getCurrentUserId () ?? self :: DEFAULT_USER_ID );
206+ $ select ->where ('user_id=? OR user_id is NULL ' , $ this ->getUserId () );
207207 }
208208
209209 return $ select ;
@@ -219,7 +219,7 @@ private function prepareInsert(array $data): array
219219 {
220220 // check if the table has not been overridden for backward compatibility
221221 if ($ this ->getMainTable () === $ this ->getTable ('importexport_importdata ' )) {
222- $ data ['user_id ' ] = $ this ->getCurrentUserId () ?? self :: DEFAULT_USER_ID ;
222+ $ data ['user_id ' ] = $ this ->getUserId () ;
223223 }
224224
225225 return $ data ;
@@ -236,7 +236,7 @@ private function prepareDelete(array $where): array
236236 // check if the table has not been overridden for backward compatibility
237237 if ($ this ->getMainTable () === $ this ->getTable ('importexport_importdata ' )) {
238238 // user_id is NULL part is for backward compatibility
239- $ where ['user_id=? OR user_id is NULL ' ] = $ this ->getCurrentUserId () ?? self :: DEFAULT_USER_ID ;
239+ $ where ['user_id=? OR user_id is NULL ' ] = $ this ->getUserId () ;
240240 }
241241
242242 return $ where ;
@@ -245,10 +245,10 @@ private function prepareDelete(array $where): array
245245 /**
246246 * Get current user ID
247247 *
248- * @return int|null
248+ * @return int
249249 */
250- private function getCurrentUserId (): ? int
250+ private function getUserId (): int
251251 {
252- return $ this ->authSession ->isLoggedIn () ? $ this ->authSession ->getUser ()->getId () : null ;
252+ return $ this ->authSession ->isLoggedIn () ? $ this ->authSession ->getUser ()->getId () : self :: DEFAULT_USER_ID ;
253253 }
254254}
0 commit comments