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

Giving an invalid view for an app makes the "edition" button disappear from change-layout hover menu #3475

Open 6TELOIV opened 1 month ago

6TELOIV commented 1 month ago

I'm submitting a

[x] bug report [x] feature request

...about

[x] edit experience / UI [x] admin experience UI

Current Behavior / Expected Behavior

With the new polymorphism selection where you can type whatever you want, invalid values are allowed, and if there is no default (non-polymorph) view, then the user cannot restore their function without resetting their cookies.

I think the correct behavior would be to either give the default/fallback view a reserved name like default or noname, and validate before storing the cookie that the view selected is valid.

Alternatively, could add some code that on error if the polymorph cookie is set, add a button to clear the cookie above/below the error.

One more option would be ensuring that the polymorph picking button is always available if the cookie is set.

Last option, change the UI for how the polymorph is selected to be an actual select/dropdown that contains only valid entries.

Instructions to Reproduce the Problem

  1. Make an app with view polymorphism.
  2. Hover on the View picker, and type in an invalid view name image image
  3. You will see an error (this part is expected) Error: ToSic.Sxc.Engines.RenderingException: The template file '/Portals/0/2sxc/App1/Default.cshtml🎯' does not exist
  4. You now will not be able to change back to a valid view polymorph: image

Your environment

iJungleboy commented 1 month ago

thanks for this ;)

It's still a bit beta.

if you did this, just look for the cookie and delete it for now.

iJungleboy commented 1 month ago

BTW: congrats to discovering this feature - it hasn't really been released yet ;)

6TELOIV commented 1 month ago

Cool! Yeah, I found the cookie, I tested it on a local DNN installation cause I didn't wanna break prod haha!