Skip to content
Browse files

# [#30416] duplicate alias in banner manager on pressing save as copy

  • Loading branch information...
1 parent 5c51f56 commit dba18d18d14e467196b3aa72a0e18f8917fda16b @infograf768 infograf768 committed Apr 5, 2013
Showing with 34 additions and 0 deletions.
  1. +31 −0 administrator/components/com_banners/models/banner.php
  2. +3 −0 installation/CHANGELOG
View
31 administrator/components/com_banners/models/banner.php
@@ -515,4 +515,35 @@ protected function prepareTable($table)
// Increment the content version number.
$table->version++;
}
+
+ /**
+ * Method to save the form data.
+ *
+ * @param array The form data.
+ *
+ * @return boolean True on success.
+ * @since 1.6
+ */
+
+ public function save($data)
+ {
+ $app = JFactory::getApplication();
+
+ // Alter the name for save as copy
+ if ($app->input->get('task') == 'save2copy')
+ {
+ list($name, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['name']);
+ $data['name'] = $name;
+ $data['alias'] = $alias;
+ $data['state'] = 0;
+ }
+
+ if (parent::save($data))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
}
View
3 installation/CHANGELOG
@@ -25,6 +25,9 @@ $ -> Language fix or change
- -> Removed
! -> Note3
+05-Apr-2013 Jean-Marie Simonet
+ # [#30416] duplicate alias in banner manager on pressing save as copy
+
04-Apr-2013 Mark Dexter
# Reverting [#30430] Severe bug with "com_content" component routing.

0 comments on commit dba18d1

Please sign in to comment.
Something went wrong with that request. Please try again.