? ? Success

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
21 Sep 2014

Scope

Joomla have two different approaches when it comes to automatically handle the aliases of articles. In batch and copy methods will automatically create increments of the alias that has to be replicated, and in creation of a new article will give an error message Save failed with the following error: Another article from this category has the same alias. This PR aligns the last to the former allowing automatically creation of a known alias (if the alias already exists) and throwing a warning message informing the user for further action (if they want to change it, altogether).
This PR only handles new articles with the field alias left EMPTY
and is a response to the conversation in this #4246

Also I realize the significance of the alias, url slug in SEO, (thats if the site uses the Search Engine Friendly URLs) but:
1. There is a warning, so the user can take further steps to fix it, if he wants
2. I guess this is a really minor comparing it to the broken routes that Joomla still can so easily create #3415

B/C

Although I don’t see how this can be a backwards compatibility break I realize that is a major change in the UX. Instead of denial to save, Joomla will come up with a successful save AND a warning.

Testing

Start with a new article, with a title something new or whatever you want, leave the alias field empty
save it
repeat the process with the same title, leave the alias field empty, save it
error Save failed with the following error: Another article from this category has the same alias and no save
Apply the patch
create an article with the same title, leave the alias field empty save it.
Success and a warning message
Repeat with Unicode alias enabled in config and try getting title in another language (in multilingual setup)


Current Joomla behavior:

screenshot 2014-09-21 19 06 47

After patch:
screenshot 2014-09-21 19 06 03

avatar dgt41 dgt41 - open - 21 Sep 2014
avatar jissues-bot jissues-bot - change - 21 Sep 2014
Labels Added: ?
avatar dgt41 dgt41 - change - 21 Sep 2014
The description was changed
avatar dgt41
dgt41 - comment - 21 Sep 2014

:+1: Thanks @brianteeman

6aef3df 21 Sep 2014 avatar dgt41 CS
avatar infograf768
infograf768 - comment - 22 Sep 2014

My test this does not work as should here;
If we create a new article with the same Title , alias field empty, in another category than the existing article, then we still get the Warning. (FYI, the alias is not incremented, which is correct)

avatar dgt41
dgt41 - comment - 22 Sep 2014

@infograph768 Thanks, nice catch, seems it need some more logic on the warning. I ll come up with some code.

avatar infograf768
infograf768 - comment - 22 Sep 2014

Maybe something like this:

if (in_array($app->input->get('task'), array('apply', 'save', 'save2new')) && (int) $app->input->get('id') == 0)
        {
            if ($data['alias'] == null)
            {
                if (JFactory::getConfig()->get('unicodeslugs') == 1)
                {
                    $data['alias'] = JFilterOutput::stringURLUnicodeSlug($data['title']);
                }
                else
                {
                    $data['alias'] = JFilterOutput::stringURLSafe($data['title']);
                }

                $table = JTable::getInstance('Content', 'JTable');

                if ($table->load(array('alias' => $data['alias'], 'catid' => $data['catid'])))
                {
                    $msg = JText::_('COM_CONTENT_SAVE_WARNING');
                }

                list($title, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['title']);
                $data['alias'] = $alias;

                if (isset($msg))
                {
                    $app->enqueueMessage($msg, 'warning');
                }
            }
avatar dgt41 dgt41 - change - 22 Sep 2014
The description was changed
avatar infograf768
infograf768 - comment - 23 Sep 2014

Works fine. One more tester.

avatar b2z
b2z - comment - 24 Sep 2014

@test ok

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar b2z b2z - test_item - 24 Sep 2014 - Tested successfully
avatar b2z b2z - alter_testresult - 24 Sep 2014 - infograf768: Tested successfully
avatar infograf768 infograf768 - change - 25 Sep 2014
Labels Added: ?
avatar infograf768 infograf768 - change - 25 Sep 2014
Labels Added: ?
avatar infograf768
infograf768 - comment - 25 Sep 2014

As we have a new string, lets' wait 3.4.0 to merge or merge into 3.4.0dev

avatar dgt41 dgt41 - close - 25 Sep 2014
avatar dgt41 dgt41 - change - 25 Sep 2014
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2014-09-25 14:33:18
avatar dgt41 dgt41 - reopen - 25 Sep 2014
avatar dgt41 dgt41 - change - 25 Sep 2014
Status Closed New
avatar KISS-Web-Design
KISS-Web-Design - comment - 25 Sep 2014

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a temporary error. The following address(es) deferred:

chris.jones-gill@ntlworld.com
Domain kisswebdesign.co.uk has exceeded the max emails per hour (107/100 (107%)) allowed. Message will be reattempted later

------- This is a copy of the message, including all the headers. ------
Received: from github-smtp2-ext8.iad.github.net ([192.30.252.199]:49835 helo=github-smtp2b-ext-cp1-prd.iad.github.net)
by duffman.enixns.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256)
(Exim 4.82)
(envelope-from noreply@github.com)
id 1XXCNz-000bBB-1J
for chris.jones-gill@kisswebdesign.co.uk; Thu, 25 Sep 2014 17:59:19 +0100
Date: Thu, 25 Sep 2014 07:33:21 -0700
From: Dimitri Grammatiko notifications@github.com
Reply-To: joomla/joomla-cms reply@reply.github.com
To: joomla/joomla-cms joomla-cms@noreply.github.com
Message-ID:
In-Reply-To:
References:
Subject: Re: [joomla-cms] Unify the way joomla handles alias for articles
(#4316)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_542427b1bb178_3f623fb0568732a075154b";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Recipient: KISS-Web-Design
List-ID: joomla/joomla-cms
List-Archive: https://github.com/joomla/joomla-cms
List-Post: reply@reply.github.com
List-Unsubscribe: unsub+i-43339396-2c07a827292d011b3859c0898ec58b24f264493f-1520943@reply.github.com,
https://github.com/notifications/unsubscribe/1520943__eyJzY29wZSI6Ik5ld3NpZXM6TXV0ZSIsImV4cGlyZXMiOjE3MjcyNzQ4MDEsImRhdGEiOnsiaWQiOjQzMTA4MDU3fX0=--a18ccfd901d70506ec60e6ca9fe45612188a9562
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: chris.jones-gill@kisswebdesign.co.uk
X-enixltd-MailScanner-Information: Please contact the ISP for more information
X-enixltd-MailScanner-ID: 1XXCNz-000bBB-1J
X-enixltd-MailScanner: Found to be clean
X-enixltd-MailScanner-SpamCheck: not spam, SpamAssassin (not cached,
score=-4.84, required 5, autolearn=not spam, BAYES_00 -1.90,
HTML_IMAGE_ONLY_12 2.06, HTML_MESSAGE 0.00, RCVD_IN_DNSWL_HI -5.00,
SPF_PASS -0.00, URIBL_BLOCKED 0.00)
X-enixltd-MailScanner-From: noreply@github.com
X-Spam-Status: No

----==_mimepart_542427b1bb178_3f623fb0568732a075154b
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Closed #4316.


Reply to this email directly or view it on GitHub:
#4316 (comment)
----==_mimepart_542427b1bb178_3f623fb0568732a075154b
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Closed #4316.


Reply to this email directly or view it on GitHub.

----==_mimepart_542427b1bb178_3f623fb0568732a075154b--

avatar zero-24 zero-24 - change - 26 Sep 2014
Category Administration Components Language & Strings UI/UX
avatar zero-24 zero-24 - change - 26 Sep 2014
Status New Ready to Commit
avatar dbhurley
dbhurley - comment - 26 Sep 2014

This has been merged into 3.4-dev. Thanks!

avatar dbhurley dbhurley - close - 26 Sep 2014
avatar dbhurley dbhurley - change - 26 Sep 2014
Status Ready to Commit Closed
Closed_Date 2014-09-25 14:33:18 2014-09-26 13:13:58
avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment