File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -119,9 +119,13 @@ public function getActions()
119119 return $ this ->actionsByRow ();
120120 }
121121
122+ /**
123+ * Clones the initial query (to avoid modifying it)
124+ * and get a model by an Id
125+ */
122126 public function getModelWhoFiredAction ($ id )
123127 {
124- return $ this ->initialQuery ->find ($ id );
128+ return ( clone $ this ->initialQuery ) ->find ($ id );
125129 }
126130
127131 public function updatedAllSelected ($ value )
@@ -145,7 +149,7 @@ public function getInitialQueryProperty()
145149 */
146150 public function getQueryProperty (Searchable $ searchable , Filterable $ filterable , Sortable $ sortable )
147151 {
148- $ query = $ this ->initialQuery ;
152+ $ query = clone $ this ->initialQuery ;
149153 $ query = $ searchable ->searchItems ($ query , $ this ->searchBy , $ this ->search );
150154 $ query = $ filterable ->applyFilters ($ query , $ this ->filters (), $ this ->filters );
151155 $ query = $ sortable ->sortItems ($ query , $ this ->sortBy , $ this ->sortOrder );
You can’t perform that action at this time.
0 commit comments