Giter Site home page Giter Site logo

Comments (8)

silverstripe-issues avatar silverstripe-issues commented on June 15, 2024

comment by: @stevevu (aragonne)
created at: 2012-01-10


I forgot to note that there is a discussion in the forum regarding this topic: http://www.silverstripe.org/general-questions/show/18938

from silverstripe-cms.

silverstripe-issues avatar silverstripe-issues commented on June 15, 2024

comment by: @sminnee (sminnee)
created at: 2012-04-23


I believe that this is still an issue in 3.0.

from silverstripe-cms.

patricknelson avatar patricknelson commented on June 15, 2024

I can verify this is still an issue in 3.1.x. I may have a potential solution, which works pretty well for me and passes unit tests:

    public function init() {
        parent::init();

        // Redirect this request, but only if no additional action (slug) has been provided.
        $action = $this->request->param('Action');
        if($action === null && $link = $this->redirectionLink()) {
            $this->redirect($link, 301);
            return;
        }
    }

I noticed that if you just ignore the redirect if there's an extra action/slug passed, it continues on to showing a 404 error page since naturally the specified action (e.g. asdf) will not be found. This may be pretty safe since, if overridden, it will function as expected. Do you anticipate any problems with this fix? If not, I can whip something up pretty quickly for review.

Should this be performed on the 3 branch or 3.1? Also, doesn't this bug belong in the CMS repo silverstripe/silverstripe-cms since my fix applies to the file located under cms/code/model/RedirectorPage.php?

from silverstripe-cms.

tractorcow avatar tractorcow commented on June 15, 2024

Low priority, but existing issue.

from silverstripe-cms.

patricknelson avatar patricknelson commented on June 15, 2024

@tractorcow Thanks for reminding me of this issue since it continues to haunt us to this day, despite all my other PR's since this is a real-world bug for me that's out in the wild, I may want to tackle sooner rather than later. What say you to the above proposition?

Should this be performed on the 3 branch or 3.1? Also, doesn't this bug belong in the CMS repo silverstripe/silverstripe-cms since my fix applies to the file located under cms/code/model/RedirectorPage.php?

Highlighted the two important questions here, but the approach is also important (see code).

from silverstripe-cms.

patricknelson avatar patricknelson commented on June 15, 2024

Actually @tractorcow my particular issue is actually already in progress here: #1198 It still looks to me, however, like this issue belongs in https://github.com/silverstripe/silverstripe-cms/issues

from silverstripe-cms.

tractorcow avatar tractorcow commented on June 15, 2024

I think it's ok to leave it here, for now. As long as it's on one of the core modules it'll get tracked.

I would fix this on the 3 branch, in answer to your question. :) It can be fixed in master only if necessary.

from silverstripe-cms.

maxime-rainville avatar maxime-rainville commented on June 15, 2024

I replicated this set up in SS 4.3 and everything is being served as expected:

  • Accessing RP, redirects you
  • Accessing UP, returns a 404
  • Access PP, returns a page.
  • Accessing UP while logged in with stage enabled return the draft page.

So this issue doesn't affect SilverStripe 4.

Unfortunately, SilverStripe 3 has entered limited support in June 2018. This means we'll only be fixing critical bugs and security issues for SilverStripe 3 going forward.

You can read the SilverStripe Roadmap for more information on our support commitments.

from silverstripe-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.