?
avatar erichforler
erichforler
26 Nov 2014

Steps to reproduce the issue

  1. Create a category named "projects"
  2. Create a second category named p1 and make it a child of "projects".
  3. Create a third category named 1.2.3 and make it a child of p1. Save it with the default alias 1-2.3.
  4. Create a menu entry of the List All Categories type and select "projects".
  5. Go to the front end of the site and navigate to the new menu entry.
  6. Click on it so that you see subcategory p1.
  7. Click on p1 so that you see the subcategory 1.2.3.
  8. Click on 1.2.3

Make sure that your Article Manager | Options | Category | Empty Categories, is set to Show.

Expected result

Should display an empty category list.

Actual result

You get a 404 error.

System information (as much as possible)

LAMP stack.
Joomla 3.3.6

Additional comments

If you put any text character at the start of the alias string (eg. v1-2-3 instead of just 1-2-3) the problem goes away.

Summary
Alias should not allow only numbers.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar erichforler erichforler - open - 26 Nov 2014
avatar brianteeman
brianteeman - comment - 26 Nov 2014

Because of the way the router currently works I think this will have to be marked as a known issue.
Unless someone has a solution to propose.

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5215.

avatar erichforler
erichforler - comment - 26 Nov 2014

It would be better to reject a strictly numerical alias as invalid or to append an acceptable character like a ~ to the start of the string to make it valid.

It's a bizarre issue to encounter as a user and the cause isn't immediately obvious. When I first encountered the problem, I wasn't getting a 404 but was instead being redirected to another page on the site which somehow corresponded to that numerical string.

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5215.

avatar infograf768
infograf768 - comment - 27 Nov 2014

I confirm the issue: the first character in the alias should not be a figure.
We could prevent this when we check the alias when saving and throw an error.

avatar infograf768
infograf768 - comment - 27 Nov 2014

but this check would have to be done all over in core...

EDIT: it seems aliases are always using
JApplication::stringURLSafe()
So, it "could" be done in the helper itself only.

avatar infograf768
infograf768 - comment - 27 Nov 2014

hmm, thinking further: we DO have the issue also when a date is entered as alias.
This happens when the alias is automatically generated as a date when the title is a non latin utf8 and transliteration is used instead of unicode alias.
We would get for example
2014-11-27-09-55-00

And, when testing in the same conditions as the original post I would get here:
http://localhost:8888/trunkgitnew/article-category-list/239-extensions/2014-11-27-09-55-00.html

=> 404

bad indeed...

avatar infograf768
infograf768 - comment - 27 Nov 2014

A solution could be to change the stringURLSafe($string) in JApplicationHelper to

    public static function stringURLSafe($string)
    {
        if (JFactory::getConfig()->get('unicodeslugs') == 1)
        {
            $output = JFilterOutput::stringURLUnicodeSlug($string);
        }
        else
        {
            $output = JFilterOutput::stringURLSafe($string);
        }

        if (preg_match('/^[0-9]$/', $output[0]))
        {
            $output = '~' . $output;
        }

        return $output;
    }
avatar Hackwar
Hackwar - comment - 28 Nov 2014

Changing this method would break backwards compatibility. As @brianteeman correctly wrote, at this moment we can only mark this as a known issue.

avatar infograf768
infograf768 - comment - 28 Nov 2014

As you may have read, I wrote "could".
It would be B/C BUT would prevent creating first level links/url with a figure as first character in the alias, as those work fine.

As the case exists when the alias is automatically created as a date, a solution would at least be to send an alert.

avatar brianteeman brianteeman - change - 3 Jan 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 19 Jul 2015
Status New Needs Review
avatar brianteeman
brianteeman - comment - 19 Jul 2015

Setting to needs review


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5215.

avatar brianteeman brianteeman - change - 29 Jul 2015
Category Router / SEF
avatar KlausKrippeit
KlausKrippeit - comment - 24 Oct 2015

@test not reproducible


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5215.

avatar astridx
astridx - comment - 24 Oct 2015

I tested it with the sample data and I see wrong articles. The first article belongs to the categorie Components ….

avatar zero-24
zero-24 - comment - 24 Oct 2015

Closing as we have a PR here that fix that in a B/C way: #8141

Thanks :smile:

avatar zero-24 zero-24 - change - 24 Oct 2015
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2015-10-24 14:43:10
Closed_By zero-24
avatar zero-24 zero-24 - close - 24 Oct 2015

Add a Comment

Login with GitHub to post a comment