Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zik137] issue with routing #562

Closed
Portugao opened this issue May 2, 2014 · 7 comments
Closed

[zik137] issue with routing #562

Portugao opened this issue May 2, 2014 · 7 comments
Assignees
Milestone

Comments

@Portugao
Copy link

Portugao commented May 2, 2014

Calling:

index.php?module=muvideo&type=admin&func=main

leads me to:

index.php?module=muvideo&type=collection&func=view&lct=admin

@Guite Guite added the upcoming label May 2, 2014
@Guite Guite added this to the 0.6.2 milestone May 2, 2014
@Guite Guite self-assigned this May 2, 2014
@Guite Guite added the zk 1.3.x label May 2, 2014
@Guite
Copy link
Owner

Guite commented May 3, 2014

This is on purpose, since we are switching to having one controller for each entity. Admin and user controllers are only there for backwards compatibility reasons. See #465 for more information.

@Guite Guite closed this as completed May 3, 2014
@Guite Guite removed the upcoming label May 3, 2014
@Portugao
Copy link
Author

Portugao commented May 3, 2014

And this contains that shorturls are not working at the moment?

If I call:

domain/muvideo

I get:

domain/index.php?module=muvideo&type=collection&func=view&lct=user

@Guite
Copy link
Owner

Guite commented May 4, 2014

Yes, because the "old-style" short urls are only possible for type=user. But you can still create links to them and they will still be recognised (as we do not throw a 301 status when doing the redirect).

@Guite
Copy link
Owner

Guite commented May 4, 2014

I will review whether we can improve this for 1.3.x again.

@Guite Guite reopened this May 4, 2014
@Guite Guite added the upcoming label May 4, 2014
@Guite
Copy link
Owner

Guite commented May 5, 2014

Please try the following:

In modules/MUVideo/lib/MUVideo/Controller/Base/User.php go to the view method and replace:

        // forward GET parameters
        $redirectArgs = $this->request->query->getCollection();

        // remove unrequired fields
        if (isset($redirectArgs['module'])) {
            unset($redirectArgs['module']);
        }
        if (isset($redirectArgs['type'])) {
            unset($redirectArgs['type']);
        }
        if (isset($redirectArgs['func'])) {
            unset($redirectArgs['func']);
        }
        if (isset($redirectArgs['ot'])) {
            unset($redirectArgs['ot']);
        }

        // add information about legacy controller type (admin/user)
        $redirectArgs['lct'] = 'user';

        // redirect to entity controller
        $redirectUrl = ModUtil::url($this->name, $objectType, 'view', $redirectArgs);

        return $this->redirect($redirectUrl);

by

        System::queryStringSetVar('lct', 'user');
        $this->request->query->set('lct', 'user');

        return ModUtil::func($this->name, $objectType, 'view', array('lct' => 'user'));

@Guite
Copy link
Owner

Guite commented May 5, 2014

Fix applied in 9c27c24

@Guite Guite closed this as completed May 5, 2014
@Guite Guite removed the upcoming label May 5, 2014
@Portugao
Copy link
Author

Portugao commented May 6, 2014

👍
Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants