File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
administrator/components/com_banners/src/Table Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,15 @@ public function store($updateNulls = true)
216216 {
217217 $ db = $ this ->getDbo ();
218218
219+ // Verify that the alias is unique
220+ $ table = new self ($ db , $ this ->getDispatcher ());
221+
222+ if ($ table ->load (['alias ' => $ this ->alias , 'catid ' => $ this ->catid ]) && ($ table ->id != $ this ->id || $ this ->id == 0 )) {
223+ $ this ->setError (Text::_ ('COM_BANNERS_ERROR_UNIQUE_ALIAS ' ));
224+
225+ return false ;
226+ }
227+
219228 if (empty ($ this ->id )) {
220229 $ purchaseType = $ this ->purchase_type ;
221230
@@ -261,15 +270,6 @@ public function store($updateNulls = true)
261270 $ this ->setError ($ oldrow ->getError ());
262271 }
263272
264- // Verify that the alias is unique
265- $ table = new self ($ db , $ this ->getDispatcher ());
266-
267- if ($ table ->load (['alias ' => $ this ->alias , 'catid ' => $ this ->catid ]) && ($ table ->id != $ this ->id || $ this ->id == 0 )) {
268- $ this ->setError (Text::_ ('COM_BANNERS_ERROR_UNIQUE_ALIAS ' ));
269-
270- return false ;
271- }
272-
273273 // Store the new row
274274 parent ::store ($ updateNulls );
275275
You can’t perform that action at this time.
0 commit comments