Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Some skin-related image requests are done with invalid URLs after upgrading to 12.1

    OK, so still working my way through testing upgrading to 12.1, and i think i've found something else strange.

    I have upgraded the load_skin and skin_styles to incorporate your changes since the last time we forked our skin.

    As i mentioned in another thread, our custom skin resides in "/skins/myskin" in our war, as it always have. To point this out, i have this in the beginning of the load_skin:

    Code:
    isc.Page.setSkinDir("skins/myskin/");
    isc.Page.loadStyleSheet("skins/myskin/skin_styles.css", theWindow);
    , and in my jsp loading page i have
    Code:
    <script type="text/javascript" language="javascript" src="/skins/myskin/load_skin.js"></script>
    What i can see now in 12.1 is that i see various requests for image URLs that are wrong...
    Like this:
    Code:
    http://127.0.0.1:8888/myapp/sc/skins/myskin/images/blank.gif
    or this:
    Code:
    http://127.0.0.1:8888/myapp/sc/skins/myskin/images/ToolStrip/separator.png
    ...or this:
    Code:
    http://127.0.0.1:8888/myapp/sc/skins/myskin/images/loadingSmall.gif
    But it's only for some resources, others are correct, like:
    Code:
    http://127.0.0.1:8888/skins/myskin/images/pickers/pickers_sprite.png
    Notice that the app name and /sc/ directory is included for some reason, although i have not referred to it anywhere in my skin related code. This did not happen in prior smartgwt versions as far as i know.

    Any thoughts?
    Last edited by mathias; 29 Apr 2020, 13:43.

    #2
    Where in this directory structure is your start .html file? If it's under myapp/sc then the first two paths are right, since you specified a relative skinDir (no leading slash).

    In earlier versions, this same config would have behaved the same. So perhaps when you copied it into 12.1 you dropped a leading slash? Or maybe you used to have another call to setSkinDir(), or some other two-wrongs-make-a-right situation.

    Sprited requests happen to be doing what you want since those URLs are embedded in CSS, and so rely on the relative path from the CSS file to the media file.

    Comment


      #3
      The landing jsp is in the root of the war, always has been.

      I too have thought that the lack of leading slashes might have something to do with this behavior. :)

      However, i must say that i am sure that i have never had leading slashes, yet it has always worked prior to today. I just went into production and loaded our page which runs 6.0 (2020-04-something), there are no leading slashes yet everything works. I cannot see how anything i've done should cause this.

      Literally the only two files i have changed are load_skin and skin_styles.
      I can see that skin_styles is fetched from the correct place, despite it being defined without a leading slash as i mentioned above.

      I went in to my maven pom, changed back to 6.0:

      Code:
      <smartgwt.version>6.0-p20200316</smartgwt.version>
       <!--smartgwt.version>12.1-p20200421</smartgwt.version-->
      I then cleared out all the caches in intellij, rebuilt and restarted. Lo and behold:

      Code:
      http://127.0.0.1:8888/skins/myskin/images/blank.gif
      I have no idea what it is, but to me it seems like something must have changed.

      I guess i'll go in and add the leading slash.

      Comment


        #4
        The stylesheet would be loaded from the place you expect because you provided the path to it explicitly, so that is unsurprising.

        As far as why things worked on a previous version, if you want to figure out what's really going on, you could go back and look at what's happening with skinDir, eg observe() it and log a stack trace to see what's changing it and to what values.

        Comment


          #5
          OK, after having spent way too long debugging this darned thing, i think i have found the issue.

          The issue is not the leading slashes, it works with or without, just as in previous smartGWT versions.

          The problem is this:

          Code:
                  if (isc.setCurrentSkin) isc.setCurrentSkin("MySkin");
          This is something that's been in the end of load_skin since forever, and i've had it lying there since it was in the file.

          However, in 12.1, if you have it there, it will cause smartGWT to fetch the files from /sc/skins/"currentskin", even if you have called "setSkinDir" as i have.

          Just try adding and removing that line, and reloading the page you will see the behavior change.

          To say that this was not crystal clear to me is an understatement...

          Is this "working as intended"? Is there any other side-effect when i remove that line?

          Comment


            #6
            This is definitely our bug - really sorry you had to spend all that time tracking that down. Very much appreciate the very specific report. A patch is in the works and should ship with the May 2 build (might make it into May 1).

            In the meantime, it should be the case that if you call:

            Code:
            isc.setCurrentSkin();
            Just like that with no arguments, it should autodetect both the name and the proper skinDir to set - and that will continue to work after this upcoming patch.

            Comment


              #7
              Did you get around to fixing this? I tried 2020-05-04 and the thing is still there. EDIT: can confirm that isc.setCurrentSkin() works though.
              Last edited by mathias; 5 May 2020, 06:24.

              Comment


                #8
                Hello, I am still seeing this issue in 2020-06-25, has this been fixed? Thanks

                Comment


                  #9
                  We've just made a logic tweak to fix this - please retest with a build dated July 28 or later.

                  Comment

                  Working...
                  X