Giter Site home page Giter Site logo

Comments (3)

drewwills avatar drewwills commented on September 3, 2024

Good catch!

from uportal.

dodie avatar dodie commented on September 3, 2024

Hi!

I could not reproduce the bug with the steps presented in the issue,
however, I could break the sitemap with the following steps:

  • Visit http://localhost:8080/uPortal/
  • Scroll to the bottom of the page, click the "uPortal Links" entry in the sitemap.
  • Which leads to the login page; sign in with "admin".
  • The sitemap will not work on any of the pages anymore, no matter where I navigate. (The "unable to load sitemap" message is shown.)

As a first step, I've corrected the typo, suggested in the issue. This did not solve the Sitemap problem,
but at least it makes the ReferenceError disappear, so another error message is visible in the Console:

Unable to load sitemap. Error: Missing required object path [layout.navigation.tabs] > content > content
    at render.uP:739
    at aY (lodash.min.js:1)
    at Function.mh (lodash.min.js:6)
    at sitemapJsonCheck (render.uP:737)
    at render.uP:780
    at aY (lodash.min.js:1)
    at Function.mh (lodash.min.js:6)
    at render.uP:779
    at aY (lodash.min.js:1)
    at Function.mh (lodash.min.js:6)

I've compared the layout.json that is downloaded by the Sitemap script, and it seems that it contains an additional invalid entry when it can't render. It is indeed missing the tabs > content > content entry:

            "tabs": [
                
                {
                    "ID": "ft1",
                    "name": "uPortal Links",
                    "type": "regular",
                    "hidden": "false",
                    "unremovable": "true",
                    "immutable": "true",
                    "addChildAllowed": "false",
                    "deleteAllowed": "false",
                    "editAllowed": "false",
                    "moveAllowed": "false",
                    "precedence": "100.0",
                    "transient": "true",
                    "tabGroup": "DEFAULT_TABGROUP",
                    "width": "100%",
                    
                    "content": [
                    
                                        {
                                            "_objectType": "portlet",
                                            "url": "/uPortal/api/v4-3/portlet/uportal-links.html",
                                            "iconUrl": "/uPortal/media/skins/icons/mobile/links.png",
                                            "ID": "ctf1",
                                            "typeID": "3",
                                            "deleteAllowed": "false",
                                            "moveAllowed": "false",
                                            "name": "uPortal Links",
                                            "description": "Useful uPortal links.",
                                            "title": "uPortal Links",
                                            "chanID": "112",
                                            "fname": "uportal-links",
                                            "timeout": "10000",
                                            "transient": "true",
                                            "windowState": "maximized",
                                            "portletMode": "view",
                                            "portletName": "cms",
                                            "lifecycleState": "PUBLISHED",
                                            "webAppName": "\/SimpleContentPortlet",
                                            
                                            "parameters": {
                                                
                                                    "mobileIconUrl": "\/uPortal\/media\/skins\/icons\/mobile\/links.png",
                                                    "iconUrl": "\/ResourceServingWebapp\/rs\/tango\/0.8.90\/32x32\/mimetypes\/text-html.png",
                                                    "disableDynamicTitle": "true",
                                                    "configurable": "true"
                                            }
                                        }
                    ]
                },
...

The "bad" JSON contains all the good data as well, but currently, the sitemap script blows up as it encounters the first entry it can't handle.

I think there are (at least) two ways to solve this problem:

  • modify the layout.json to exclude such entries
  • make the sitemap generation script more resilient

I am not familiar with the layout.json generation (and it might be used somewhere else outside the sitemap), so I created a fix using the latter approach: now the sitemap simply ignores the elements it does not know.

Please let me know if this approach is okay.

Cheers and thanks,
David

from uportal.

drewwills avatar drewwills commented on September 3, 2024

#1364

Please let me know if this approach is okay.

Speaking in general terms, I think there's nothing wrong with this approach.

from uportal.

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.