Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,13 @@ public function store($updateNulls = true)
$table = Table::getInstance('ContactTable', __NAMESPACE__ . '\\', array('dbo' => $this->getDbo()));

if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0)) {
// Is the existing contact trashed?
$this->setError(Text::_('COM_CONTACT_ERROR_UNIQUE_ALIAS'));

if ($table->published === -2) {
$this->setError(Text::_('COM_CONTACT_ERROR_UNIQUE_ALIAS_TRASHED'));
}

return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function store($updateNulls = true)
$table = new static($this->getDbo());

if ($table->load(array('alias' => $this->alias)) && ($table->filter_id != $this->filter_id || $this->filter_id == 0)) {
$this->setError(Text::_('JLIB_DATABASE_ERROR_ARTICLE_UNIQUE_ALIAS'));
$this->setError(Text::_('COM_FINDER_FILTER_ERROR_UNIQUE_ALIAS'));

return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,13 @@ public function store($updateNulls = true)
$table = Table::getInstance('NewsfeedTable', __NAMESPACE__ . '\\', array('dbo' => $this->_db));

if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0)) {
// Is the existing newsfeed trashed?
$this->setError(Text::_('COM_NEWSFEEDS_ERROR_UNIQUE_ALIAS'));

if ($table->published === -2) {
$this->setError(Text::_('COM_NEWSFEEDS_ERROR_UNIQUE_ALIAS_TRASHED'));
}

return false;
}

Expand Down
5 changes: 5 additions & 0 deletions administrator/components/com_tags/src/Table/TagTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,13 @@ public function store($updateNulls = true)
$table = new static($this->getDbo());

if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) {
// Is the existing tag trashed?
$this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS'));

if ($table->published === -2) {
$this->setError(Text::_('COM_TAGS_ERROR_UNIQUE_ALIAS_TRASHED'));
}

return false;
}

Expand Down
3 changes: 2 additions & 1 deletion administrator/language/en-GB/com_contact.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ COM_CONTACT_EMPTYSTATE_BUTTON_ADD="Add your first contact"
COM_CONTACT_EMPTYSTATE_CONTENT="Contacts can be as simple as a contact form or as complex as a staff directory. You can use this component to create and manage your contacts."
COM_CONTACT_EMPTYSTATE_TITLE="No Contacts have been created yet."
COM_CONTACT_ERROR_ALL_LANGUAGE_ASSOCIATED="A contact item set to All languages can't be associated. Associations have not been set."
COM_CONTACT_ERROR_UNIQUE_ALIAS="Another Contact from this category has the same alias (remember it may be a trashed item)."
COM_CONTACT_ERROR_UNIQUE_ALIAS="Another Contact in this category has the same alias."
COM_CONTACT_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Contact in this category has the same alias."
COM_CONTACT_FIELD_ARTICLES_DISPLAY_NUM_LABEL="# Articles to List"
COM_CONTACT_FIELD_ARTICLES_SHOW_LABEL="User Articles"
COM_CONTACT_FIELD_CAPTCHA_LABEL="Allow Captcha on Contact"
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/com_content.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ COM_CONTENT_ERROR_CANNOT_ARCHIVE="One or more of the selected articles can't be
COM_CONTENT_ERROR_CANNOT_PUBLISH="One or more of the selected articles can't be set to published."
COM_CONTENT_ERROR_CANNOT_TRASH="One or more of the selected articles can't be set to trashed."
COM_CONTENT_ERROR_CANNOT_UNPUBLISH="One or more of the selected articles can't be set to unpublished."
COM_CONTENT_ERROR_UNIQUE_ALIAS="Another Article in this category has the same alias."
COM_CONTENT_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Article in this category has the same alias."
COM_CONTENT_ERROR_UPDATE_STAGE="You cannot execute this transition and update the stage."
COM_CONTENT_FEATURED_ARTICLES="Featured Articles"
COM_CONTENT_FEATURED_CATEGORIES_LABEL="Select Categories"
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/com_finder.ini
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ COM_FINDER_FIELDSET_SEARCH_OPTIONS_LABEL="Smart Search"
COM_FINDER_FILTER_BRANCH_LABEL="Search by %s"
COM_FINDER_FILTER_EDIT_TOOLBAR_TITLE="Smart Search: Edit Filter"
COM_FINDER_FILTER_END_DATE_LABEL="End Date"
COM_FINDER_FILTER_ERROR_UNIQUE_ALIAS="Another Filter has the same alias."
COM_FINDER_FILTER_FIELDSET_PARAMS="Filter Timeline"
COM_FINDER_FILTER_FORM_TITLE_EDIT="Edit Filter"
COM_FINDER_FILTER_FORM_TITLE_NEW="New Filter"
Expand Down
3 changes: 2 additions & 1 deletion administrator/language/en-GB/com_newsfeeds.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ COM_NEWSFEEDS_EMPTYSTATE_BUTTON_ADD="Add your first news feed"
COM_NEWSFEEDS_EMPTYSTATE_CONTENT="Adding News Feeds to your sites is a way of integrating content from other web sites."
COM_NEWSFEEDS_EMPTYSTATE_TITLE="No News Feeds have been created yet."
COM_NEWSFEEDS_ERROR_ALL_LANGUAGE_ASSOCIATED="A news feed item set to All languages can't be associated. Associations have not been set."
COM_NEWSFEEDS_ERROR_UNIQUE_ALIAS="Another News feed from this category has the same alias (remember it may be a trashed item)."
COM_NEWSFEEDS_ERROR_UNIQUE_ALIAS="Another News feed from this category has the same alias."
COM_NEWSFEEDS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed News feed in this category has the same alias."
COM_NEWSFEEDS_FIELD_CACHETIME_LABEL="Cache Time"
COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_DESC="0 will show all the text."
COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_LABEL="Characters Count"
Expand Down
3 changes: 2 additions & 1 deletion administrator/language/en-GB/com_tags.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ COM_TAGS_COUNT_UNPUBLISHED_ITEMS="Unpublished items"
COM_TAGS_EMPTYSTATE_BUTTON_ADD="Add your first tag"
COM_TAGS_EMPTYSTATE_CONTENT="Tags in Joomla! provide a flexible way of organizing content. The same tag can be applied to many different content items across content types."
COM_TAGS_EMPTYSTATE_TITLE="No Tags have been created yet."
COM_TAGS_ERROR_UNIQUE_ALIAS="Another Tag has the same alias (remember it may be a trashed item)."
COM_TAGS_ERROR_UNIQUE_ALIAS="Another Tag has the same alias."
COM_TAGS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Tag has the same alias."
COM_TAGS_EXCLUDE="Exclude"
COM_TAGS_FIELD_CONTENT_TYPE_LABEL="Content types"
COM_TAGS_FIELD_FULL_LABEL="Full Image"
Expand Down
6 changes: 4 additions & 2 deletions administrator/language/en-GB/lib_joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ JLIB_DATABASE_ERROR_ADAPTER_MYSQLI="The MySQL adapter 'mysqli' is not available.
JLIB_DATABASE_ERROR_ARTICLE_UNIQUE_ALIAS="Another article from this category has the same alias (remember it may be a trashed item)."
JLIB_DATABASE_ERROR_BIND_FAILED_INVALID_SOURCE_ARGUMENT="%s: :bind failed. Invalid source argument."
JLIB_DATABASE_ERROR_CATEGORY_REQUIRED="Category is required."
JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS="Another category with the same parent category has the same alias (remember it may be a trashed item)."
JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS="Another category with the same parent category has the same alias."
JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS_TRASHED="A trashed category with the same parent category has the same alias."
JLIB_DATABASE_ERROR_CHECK_FAILED="%s: :check Failed - %s"
JLIB_DATABASE_ERROR_CHECKIN_FAILED="%s: :check-in failed - %s"
JLIB_DATABASE_ERROR_CHECKOUT_FAILED="%s: :check-out failed - %s"
Expand Down Expand Up @@ -149,8 +150,9 @@ JLIB_DATABASE_ERROR_MENU_HOME_NOT_COMPONENT="The home menu item must be a compon
JLIB_DATABASE_ERROR_MENU_HOME_NOT_UNIQUE_IN_MENU="A menu should have only one Default home."
JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_COMPONENT="A first level menu item alias can't be 'component'."
JLIB_DATABASE_ERROR_MENU_ROOT_ALIAS_FOLDER="A first level menu item alias can't be '%s' because '%s' is a sub-folder of your Joomla installation folder."
JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS="The alias <strong>%1$s</strong> is already being used by <strong>%2$s</strong> menu item in the <strong>%3$s</strong> menu (remember it may be a trashed item)."
JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS="The alias <a href=\"%4$s\" class=\"alert-link\"><strong>%1$s</strong></a> is already being used by the <strong>%2$s</strong> menu item in the <strong>%3$s</strong> menu."
JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS_ROOT="Another menu item has the same alias in Root (remember it may be a trashed item). Root is the top level parent."
JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS_TRASHED="The alias <a href=\"%4$s\" class=\"alert-link\"><strong>%1$s</strong></a> is already being used by the trashed <strong>%2$s</strong> menu item in the <strong>%3$s</strong> menu."
JLIB_DATABASE_ERROR_MENU_UNPUBLISH_DEFAULT_HOME="Can't unpublish default home."
JLIB_DATABASE_ERROR_MENUTYPE="Some menu items or some menu modules related to this menutype are checked out by another user or the default menu item is in this menu."
JLIB_DATABASE_ERROR_MENUTYPE_CHECKOUT="The user checking out does not match the user who checked out this menu and/or its linked menu module."
Expand Down
5 changes: 5 additions & 0 deletions libraries/src/Table/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,13 @@ public function store($updateNulls = true)
$table->load(array('alias' => $this->alias, 'parent_id' => (int) $this->parent_id, 'extension' => $this->extension))
&& ($table->id != $this->id || $this->id == 0)
) {
// Is the existing category trashed?
$this->setError(Text::_('JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS'));

if ($table->published === -2) {
$this->setError(Text::_('JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS_TRASHED'));
}

return false;
}

Expand Down
7 changes: 6 additions & 1 deletion libraries/src/Table/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,12 @@ public function store($updateNulls = true)
$table = Table::getInstance('Content', 'JTable', array('dbo' => $this->getDbo()));

if ($table->load(array('alias' => $this->alias, 'catid' => $this->catid)) && ($table->id != $this->id || $this->id == 0)) {
$this->setError(Text::_('JLIB_DATABASE_ERROR_ARTICLE_UNIQUE_ALIAS'));
// Is the existing article trashed?
$this->setError(Text::_('COM_CONTENT_ERROR_UNIQUE_ALIAS'));

if ($table->published === -2) {
$this->setError(Text::_('COM_CONTENT_ERROR_UNIQUE_ALIAS_TRASHED'));
}

return false;
}
Expand Down
10 changes: 9 additions & 1 deletion libraries/src/Table/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Database\DatabaseDriver;
use Joomla\Database\ParameterType;
use Joomla\Registry\Registry;
Expand Down Expand Up @@ -241,7 +242,14 @@ public function store($updateNulls = true)
if ($error) {
$menuTypeTable = Table::getInstance('MenuType', 'JTable', array('dbo' => $db));
$menuTypeTable->load(array('menutype' => $table->menutype));
$this->setError(Text::sprintf('JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS', $this->alias, $table->title, $menuTypeTable->title));
$url = Route::_('index.php?option=com_menus&task=item.edit&id=' . (int) $table->id);

// Is the existing menu item trashed?
$this->setError(Text::sprintf('JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS', $this->alias, $table->title, $menuTypeTable->title, $url));

if ($table->published === -2) {
$this->setError(Text::sprintf('JLIB_DATABASE_ERROR_MENU_UNIQUE_ALIAS_TRASHED', $this->alias, $table->title, $menuTypeTable->title, $url));
}

return false;
}
Expand Down