Results 1 to 4 of 4

Thread: Ext.route.Router.recognize() seems to be broken in 6.5.x

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Jun 2014
    Location
    Hannover, Germany
    Posts
    7

    Default Ext.route.Router.recognize() seems to be broken in 6.5.x

    Since I have no initial views in my applications, I manually check for the url hash and use Ext.route.Router.recognize() to get the route object if any route matches. My code worked in 6.2.x but stopped in 6.5.x.
    It seems to me that the implementation of this method is incorrect. The following override seems to fix the problem:

    Code:
    Ext.override(Ext.route.Router, {
        /**
         * Recognizes a url string connected to the Router, return the controller/action pair
         * plus any additional config associated with it.
         *
         * @param {String} url The url to recognize.
         * @return {Object/Boolean} If the url was recognized, the controller and action to
         * call, else `false`.
         */
        recognize: function(url) {
            var routes = this.routes,
                matches = [],
                name, route, urlParams;
            for (name in routes) {
                route = routes[name];
                if (route) {
                    urlParams = route.recognize(url);
                    if (urlParams) {
                        matches.push({
                            route: route,
                            urlParams: urlParams
                        });
                    }
                }
            }
            return matches.length ? matches : false;
        }    
    });
    The only "problem" which I see here and in the original implementation is that if a match was found, an array is returned, which mismatches the documented method's return value type:

    * @return {Object/Boolean} If the url was recognized, the controller and action to
    * call, else `false`.

  2. #2
    Sencha Premium User
    Join Date
    Dec 2015
    Posts
    18

    Default

    I'm seriously asking, can someone from sencha support tell me how on earth it is possible this bug is still exists?
    The API diff documentation was somewhat useful when migrated from 6.0 to 6.2, but 6.5 breaks almost everything, the API diff incomplete, a _minor_ version increased which breaks something almost in every component. Are you serious? I really don't want to rant there or off there, but after I've found this, something broke inside me.

  3. #3
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,425

    Default

    Quote Originally Posted by stevepn View Post
    I'm seriously asking, can someone from sencha support tell me how on earth it is possible this bug is still exists?
    The API diff documentation was somewhat useful when migrated from 6.0 to 6.2, but 6.5 breaks almost everything, the API diff incomplete, a _minor_ version increased which breaks something almost in every component. Are you serious? I really don't want to rant there or off there, but after I've found this, something broke inside me.
    I worked with the Ext JS router on a large project, and IMO this router required a lot of work to be on a par w/ other routers. A lot of this work was done for Ext JS 6.6, but now it's hard to say when this release will be available if ever.

    To his credit, the developer of the router helped me whenever I had questions or didn't know how to configure more complicated routes, but now I wish you good luck getting support since almost the entire Sencha dev staff is gone.

  4. #4
    Sencha Premium User
    Join Date
    Oct 2015
    Location
    Arvada, CO
    Posts
    76

    Default

    The ticket for this is EXTJS-28663.

Similar Threads

  1. [DUP] Router redirect with force option is calling 2 times the route handler
    By evandropoa in forum Ext JS 6.x Bugs
    Replies: 1
    Last Post: 14 Oct 2015, 2:25 PM
  2. [CLOSED] The router doesn't work when the controler is set in the route
    By xxxpinoxxx in forum Ext 5: Bugs
    Replies: 1
    Last Post: 25 Apr 2014, 4:13 AM
  3. Ext.util.Router & Ext.util.Route - Default Route proposal
    By HendrixMH in forum Ext: Discussion
    Replies: 2
    Last Post: 20 Nov 2011, 12:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •