Vulnerability in EPiServer.Forms
I've started working with an application that has a few defined page types that are based on PageTypeBuilder.
Here is the example. Let's say I have a class that has 2 string page type properties with the typeof PropertyXhtmlString. One is called Property1 and has EditCaption equal to 'Property 1' and the second one is called Property2 and has EditCaption equal to 'Property 2'.
Here are the issues I'm currently having:
Issue 1: I've added a new string PageTypeProperty called Test (typeof(PropertyLongString)), then built the project, went to CMS, checked a page based on my page type and saw the field called 'Test' under Edit/Content tab.
I then deleted the 'Test' property from my class, rebuilt the project but still see the field in the CMS. I've tried to recycle app pool and it didn't help.
How can I get rid of that field in the CMS?
Issue 2: I wanted to increase the space between the Property1 and Property2 fields in the CMS so I decided to add a line break to the EditCaption attribute like this '\r\n Property 2' but it didn't do anything.
Is there a way to space out the CMS fields that are created by the page type builder?
Issue 3: I've changed the type of the 'Property1' from PropertyXhtmlString to the PropertyLongString, rebuilt the project, went to CMS but it still shows me the field as Rich Text Editor, not the multiline text.
What is required in order for that change to be picked up by the CMS?
Any help would be appreciated.
1. You need to manually delete them in admin mode. This is by design so that you don't accidently loose any data
2. You need to use custom property like property divider for this.
3. Same here you need to change the property type in admin mode manually. By design so you don't loose any data.
Hope this helps
Issue 1: PageTypeBuilder never deletes properties, you have to do this manually in admin mode. I think there is an API for doing this too.
Issue 2: Not a PageTypeBuilder problem. I guess you could do a custom property that inserts linebreaks. Just like a divider control http://www.dodavinkeln.se/post/2009/10/15/divider-custom-property.aspx
Issue 3: I don't know exactly how conversion between different types works. But I guess it will only work between the same value types.
Haha too slow
Regarding 1 & 3: If you're using PTB 2 you can use PTB Migrations to delete properties and/or change property types through code. Take a look at this post and look the the info on Migrations.
Thank you guys!
Very much appreciated.
That's exactly what I needed.
(I'm using PTB 1.3.1)