2sic / 2sxc

DNN + 2sxc = #DNNCMS - This tool helps web designers and developers prepare great looking content in DNN (DotNetNuke). It's like mixing DNN with Umbraco and Drupal :)
http://2sxc.org
MIT License
145 stars 40 forks source link

localhost forces DevMode with bad URL #1238

Closed TopCat6 closed 7 years ago

TopCat6 commented 7 years ago

I'm submitting a ...

- [x ] bug report => search github for a similar issue before submitting 
- [ ] feature request
- [ ] support request => do not submit here, see https://2sxc.org/en/blog/post/moving-discussions-from-codeplex-to-stack-overflow
- [ ] not sure

...about

- [ ] edit experience / UI
- [x ] admin experience UI
- [ ] Razor templating
- [ ] JS development
- [ ] Content Types or data management
- [ ] APIs like REST
- [ ] DNN parts
- [ ] other / unknown

Current behavior

After adding Content module to a page on localhost, I just get a round blue icon with white glasses. Clicking on it produces an error in the console:

ReferenceError: $2sxc is not defined 1 ui.html:20:5
<anonymous> http://localhost/DotNetNuke/desktopmodules/tosic_sexycontent/dist/ng/ui.html:20:5

Clicking 'Change Template / Layout' in pencil menu also does nothing. This happened after upgrading from 2sxc 8.12 to 9.02. Expected behavior

Clicking the icon would invite you to install the default apps. Minimal reproduction of the problem with instructions

  1. Use localhost and install the 2sxc Content module extension
  2. Add the Content module to a page
  3. Click the eyeglass icon
  4. Press F12 key and go to Console
  5. Observe the error: ReferenceError: $2sxc is not defined 1 ui.html:20:5

What is the motivation / use case for changing the behavior?

  1. Edit file: DesktopModules\ToSIC_SexyContent\dist\ng\ui.html so that it does not set isDevMode to true in the following code:
    isDevMode = window.location.hostname === 'localhost'
  2. Force-reload the page and observe that the error is gone and all works properly.

Please tell us about your environment:

Anything you would like to add

iJungleboy commented 7 years ago

thx for the great bug report - will fix asap...

iJungleboy commented 7 years ago

The cause is a simple JS which checks if it's running on "localhost" and then tries to reconfigure some paths for dev-setup. This is actually not needed any more, now that we can do watched live builds with angular-cli, so we'll temporarily disable it, and remove it later on. WIP, should get fixed today...

iJungleboy commented 7 years ago

fixed...will release in a few minutes.