joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.77k stars 3.65k forks source link

Bad Links in Testing Sample Data #15863

Closed mbabker closed 6 years ago

mbabker commented 7 years ago

Got other stuff going on so no time to do PRs myself, but...

brianteeman commented 7 years ago

See #15868 for the first two - I couldnt replicate/find the last one

mbabker commented 7 years ago

This might not something you can sort out. I did another crawl to try and get the source creating that link and found this...

screen shot 2017-05-07 at 9 51 14 am
brianteeman commented 7 years ago

yeah i tested the archive sample and it seemed ok

Quy commented 7 years ago

Found the link: <base href="http://localhost/joomla-cms/index.php/archived-articles/2011" />

on this page: http://localhost/joomla-cms/index.php/archived-articles/2011?view=archive&month=1

brianteeman commented 7 years ago

But can you find it in the dB to fix?

Quy commented 7 years ago

I don't think so. I assume the base tag is dynamically being generated.

Quy commented 7 years ago

It is missing the query portion ?view=archive&month=1 that is causing the issue.

mbabker commented 7 years ago

So to me then we've got a routing bug somewhere as a URL should be valid when SEF is enabled with no query strings attached.

On Mon, May 15, 2017 at 5:53 PM Quy notifications@github.com wrote:

It is missing the query portion ?view=archive&month=1 that is causing the issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joomla/joomla-cms/issues/15863#issuecomment-301627656, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWfobeH33DKVDwgFelqnid_8eC8FbJeks5r6Nd4gaJpZM4NS-KN .

--

  • Michael Please pardon any errors, this message was sent from my iPhone.
Quy commented 7 years ago

This link is generated: http://localhost/joomla-cms/index.php/archived-articles/2011?view=archive&month=1

when it should be: http://localhost/joomla-cms/index.php/archived-articles?view=archive&month=1&year=2011

I will try to track down where this URL is generated.

Quy commented 7 years ago

In \components\com_content\helpers\legacyrouter.php, the following was changed from:

        if ($view == 'archive')
        {
            if (!$menuItemGiven)
            {
                $segments[] = $view;
                unset($query['view']);
            }

            if (isset($query['year']))
            {
                if ($menuItemGiven)
                {
                    $segments[] = $query['year'];
                    unset($query['year']);
                }
            }

            if (isset($query['year']) && isset($query['month']))
            {
                if ($menuItemGiven)
                {
                    $segments[] = $query['month'];
                    unset($query['month']);
                }
            }
        }

to make it work:

        if ($view == 'archive')
        {
            if (!$menuItemGiven)
            {
                $segments[] = $view;
            }

            unset($query['view']);
        }

I don't know if this is the right solution. If no, then I am out of ideas.

brianteeman commented 7 years ago

@quy could you make a PR for this

Quy commented 7 years ago

@brianteeman I am out until Monday when I can do it then.

ghost commented 6 years ago

gently Reminder @Quy

Quy commented 6 years ago

Related to #13757. Please close this one. Thanks.

joomla-cms-bot commented 6 years ago

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/15863

ghost commented 6 years ago

closed as stated above.


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