@@ -200,8 +200,11 @@ public function saveBunch($entity, $behavior, array $data)
200
200
*/
201
201
private function prepareSelect (Select $ select ): Select
202
202
{
203
- // user_id is NULL part is for backward compatibility
204
- $ select ->where ('user_id=? OR user_id is NULL ' , $ this ->getCurrentUserId () ?? self ::DEFAULT_USER_ID );
203
+ // check if the table has not been overridden for backward compatibility
204
+ if ($ this ->getMainTable () === $ this ->getTable ('importexport_importdata ' )) {
205
+ // 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 );
207
+ }
205
208
206
209
return $ select ;
207
210
}
@@ -214,7 +217,10 @@ private function prepareSelect(Select $select): Select
214
217
*/
215
218
private function prepareInsert (array $ data ): array
216
219
{
217
- $ data ['user_id ' ] = $ this ->getCurrentUserId () ?? self ::DEFAULT_USER_ID ;
220
+ // check if the table has not been overridden for backward compatibility
221
+ if ($ this ->getMainTable () === $ this ->getTable ('importexport_importdata ' )) {
222
+ $ data ['user_id ' ] = $ this ->getCurrentUserId () ?? self ::DEFAULT_USER_ID ;
223
+ }
218
224
219
225
return $ data ;
220
226
}
@@ -227,8 +233,11 @@ private function prepareInsert(array $data): array
227
233
*/
228
234
private function prepareDelete (array $ where ): array
229
235
{
230
- // user_id is NULL part is for backward compatibility
231
- $ where ['user_id=? OR user_id is NULL ' ] = $ this ->getCurrentUserId () ?? self ::DEFAULT_USER_ID ;
236
+ // check if the table has not been overridden for backward compatibility
237
+ if ($ this ->getMainTable () === $ this ->getTable ('importexport_importdata ' )) {
238
+ // user_id is NULL part is for backward compatibility
239
+ $ where ['user_id=? OR user_id is NULL ' ] = $ this ->getCurrentUserId () ?? self ::DEFAULT_USER_ID ;
240
+ }
232
241
233
242
return $ where ;
234
243
}
0 commit comments