episerver / Foundation

Foundation offers a starting point that is intuitive, well-structured and modular allowing developers to explore CMS, Commerce, Personalization, Search and Navigation, Data Platform and Experimentation.
https://docs.developers.optimizely.com/digital-experience-platform/docs/optimizely-foundation-demo-sites
Apache License 2.0
132 stars 136 forks source link

Custom form elements views are not applied #828

Open SHIFT969 opened 2 years ago

SHIFT969 commented 2 years ago

Describe the bug Form elements view location "/Features/Shared/Views/ElementBlocks/{0}.cshtml" defined in FeatureViewLocationExpander is not being used.

To Reproduce

  1. Go to "Features\Shared\Views\ElementBlocks\TextboxElementBlock.cshtml"
  2. Add breakpoint anywhere or "TEST" text in <label> tag.
  3. Build and run the website.
  4. Create new with TextboxElementBlock and place it anywhere.
  5. Go to the page with the new form.
  6. Fom is rendered but custom view is not used. (no breakpoint hit, no sample text)

Expected behavior Views from location "/Features/Shared/Views/ElementBlocks/{0}.cshtml" defined in FeatureViewLocationExpander should be used.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Editing forms.config doesn't seem to work either. I assume it's episerver error.

daniel-isaacs commented 2 years ago

This should be fixed via this change: https://github.com/episerver/Foundation/commit/c22324f2044ce2880c53c4323f04cdf1bc540e7f

Working as expected for me now:

image

@SHIFT969 - can you confirm it's now functioning correctly for you as well, and this can be closed?