Localhost number changes in widgets

Topics: Customizing Orchard
Sep 25, 2012 at 8:04 PM

 I do use WebMatrix for an Orchard site. Installation of Orchard goes fine and at the end I do have a site with URL://http:localhost:41565

I do start working to add pages and frequently I do make a copy of the complete current site and put that on a different disc of my computer. If the current site is not working then I copy back the site from the other disc and continue working again.

In the side i do use pictures inside the ASIDE part (TheThemeMachine). This worked good and I made a new copy of the site.

Later i neede to restore the old site and saw that the localhost was changed into localhost:64618 Also the pictures were not showing and the property of the pictures was exact the same between the two sites but the only difference was that the localhost from the oldest site was used inside the property (41565). Editing the Widget showed the pictures and the correct localhost in the specification, but when i used Your Site the pictures were gone.

I give up, since I do not understand why this is happening. Is my method of working not correct or is there an other reason that localhost is changing?

Thanks for any clue

Sep 25, 2012 at 11:18 PM

The host name should never be in any contents, otherwise you wouldn't be able to deploy this properly. If you see localhost in your contents, something is wrong. Workaround is to edit the source of that widget and replace that fully-qualified path with a root-relative path (i.e. replace http://localhost:64618/something/somethingelse with /something/somethingelse)

Sep 26, 2012 at 11:53 AM

Bertrand, maybe my explanation is wrong, but in essence I have the following. I made an new site and started to work on it.

Since I'm learning and trying new modules I have made several backups of this site and named the folders as the original name plus -xx (example Name-01).

After I have added a widget  to get some pictures in the AsideFirst zone, (at some moment after some backups and restore were made) I did not get the pictures anymore. Entering the widget and looking at what the properties were, I saw that inside the widget i got the localhost specified correctly and the moment i look at the site and look at the properties of the picture I do see that they all heve the localhost specification of my first site.

These are the properties:

1. inside the widget page: adres            http://localhost:38473/Media/Default/HtmlWidget/Contents/Item/Display/3/1.png

2. after running the page: adres             http://localhost:41565/Media/Default/HtmlWidget/Contents/Item/Display/3/1.png

In the second point you can see there is an other localhost specified and this is the number of the first time I made the widget.
Deleting the widget and making a new widget with the same pictures gets the same result.
What could this be, what error am I making? Any clue?

Sep 26, 2012 at 6:45 PM

I do come closer to the problem now.

  1. new website made
    URL: http://localhost:16225
  2. in Aside zone i made a widget with four pictures. Site looked good and pictures in AsideFirst zone were there
  3. Made a copy of the folder on another disc
  4. continued on the original site and added new pages. Site looked good and pictures in AsideFirst zone were still there.
  5. Made a copy of the folder on another disc
  6. continued on the original site and added new pages. Site looked good and pictures in AsideFirst zone were still there.
  7. Made a copy of the folder on another disc
  8. continued on the original site and finished it. Site looked good and pictures in AsideFirst zone were still there.
  9. made a copy of the folder onto a stick
  10. took stick to an other computer and put folder on disc
  11. started WebMatrix 2 and loaded the folder with the site
  12. URL:   http://localhost:29119
  13. looked in Internet Explorer and there were NO pictures. I clicked on the picture with rightmouse and got the following adres of the picture:
  14. logged into the site and went to Widgets - AsideFirst
  15. got the widget and there were the pictures allright with the following adres:
  16. Even if i go back to widgets, delete AsideFirst widget and add a brand new widget I get the same result

How is it possible that when i use a copy of the site and use this on another computer I do get a mixed-up of localhost numbers !

My original folder is working correct on my first computer as long as I do not change the name of the folder or make a copy. 

Hope someone can help me clarify this situation. Thanks in advance

Sep 26, 2012 at 6:50 PM

Yes, that's exactly what I understood, and my answer still stands. If you look at the source view of your widget you should never see the host name. If you do, there is a problem. If you are saying that the media picker injects those absolute URLs, then that's a bug in the media picker. Please file it in the issue tracker. Workaround is to make those URLs relative to the site root.

Sep 26, 2012 at 7:00 PM
Edited Sep 26, 2012 at 7:21 PM

No, what i mean bij URL, is the SITE PAGE INSIDE wEBmatrix were you see:
- the naam of the site
- The URL of the site
- Path of the site

I only got the localhost by rightclik with the mouse on a picture or when there is no picture the place were is should be and then ask for the properties of the picture. Then you see different localhost specs for the adres of the picture.

Is the Media Picker still involved when a copy of the site is runned on another computer?

What should i mention in an issue tracker?

And how could i make the workaround, can you give me a clue how to do that?

By the way: I did enable :  URL Alternates and Widget alternates. Does that have to do with my problem


Sep 26, 2012 at 7:32 PM

Just found it.

I used the full Vandelay Industries - Version 1.4.1

After I did disabled Vandelay Relative URL Filter I got my pictures back.

It's a habit when you get a number of possibilities to enable all.

Hope you can do something with it or shouldn't I have this enabled in the first place.



Sep 30, 2012 at 9:41 PM

I see, thanks.

Oct 1, 2012 at 8:19 AM

Oke Bertrand, but still you have to enable this module again when you publish the site to a provider.
Something is wrong but I'm not able to find out what it is that the module is acting wrong during development.


Oct 2, 2012 at 1:43 AM

Let me know if you find the problem and need a fixed module.