Custom Fields become hidden
Hello,
I am having issues with my custom fields I have created for content items. I created custom fields for both the news content and blog post content as the administrator. When creating these custom fields, I check the box to make them required. This works initially, but then when an editor logs in to add one of these content items, the custom field no longer shows up as being required, it becomes hidden.
I then have to go back in as admin and make the custom field required again. Any idea as to why this may be happening?
Thank you,
Stephanie
Hello Stephanie,
The behavior you're experiencing is really odd. I tried to reproduce the issue here, but it seems that everything works as expected. I've recorded a short video for you, while testing the default functionality, can you please take a look at it and let me know if the steps you have taken differ from what I've demonstrated? Also, can you let us know if you have made any changes in the advanced settings of news and blogs modules? Looking forwards to your reply.
Greetings,
Jen Peleva
the Telerik team
Hello Jen,
Thank you for the video, I looked over it and those are the same steps I've taken. I'm not sure what was causing the issue. I thought it might be from restarting the website through IIS, but that didn't seem to produce the error either. As of now the custom field is working as it should be. In doing some testing today, I wasn't able to reproduce the the issue.
Also, I did make some changes to the advanced settings when applying the news and blog modules to certain pages. I made changes so there is a details and master view. I also made a change to the sort expression where I'm sorting by the custom field that I created.
Thank you,
Stephanie
Hello Jen,
I was able to reproduce the custom field issue that I was having. After, I deploy a website using TeamCity to the server, that is when my custom fields are no longer marked required. Therefore after deployment I must log in as admin to the site and go to each content item that has a custom field and mark the required checkbox again.
Is there a way to prevent me from having to do this every time there is an update to a website?
Thank you,
Stephanie
Hi Stephanie,
Deployment shouldn't cause such issue. Could you please take a look at your NewsConfig.contentViewControls.NewsBackend.views.NewsBackendEdit. In it you'll see all your custom fields, and the ones, marked as required, should contain required="True". Also, adding the required attribute is another way to make your fields required. You may consider it easier, since you wouldn't have to navigate to the edit panel of each custom field and add a tick the Make required option.
Best wishes,
Jen Peleva
the Telerik team
Hi Jen,
I'm sorry still kind of new to Sitefinity but I'm not quite sure where to find NewsConfig.contentViewControls.NewsBackend.views.NewsBackendEdit.
I want to be able to test this after deployment to see if it keeps the custom fields required.
And where would I add the required attribute to the fields as you suggested?
Thank you,
Stephanie
Hello Stephanie,
Look for the NewsConfig.contentViewControls.NewsBackend.views.NewsBackendEdit. file in App_Data ->Sitefinity->Configuration. If you have created a custom field called, for example, Something, you should see the following in the newsConfig file:
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
view
xmlns:config
=
"urn:telerik:sitefinity:configuration"
xmlns:type
=
"urn:telerik:sitefinity:configuration:type"
config:version
=
"4.2.1733.0"
viewName
=
"NewsBackendEdit"
>
<
sections
>
<
sections
displayMode
=
"Write"
wrapperTag
=
"Div"
name
=
"CustomFieldsSection"
>
<
fields
>
<
field
rows
=
"1"
dataFieldName
=
"Something"
wrapperTag
=
"Li"
title
=
"Something"
fieldType
=
"Telerik.Sitefinity.Web.UI.Fields.TextField"
fieldName
=
"Something"
type:this
=
"Telerik.Sitefinity.Web.UI.Fields.Config.TextFieldDefinitionElement, Telerik.Sitefinity"
>
<
expandableDefinition
expanded
=
"True"
/>
<
validator
expectedFormat
=
"None"
maxLength
=
"0"
minLength
=
"0"
required
=
"True"
alphaNumericViolationMessage
=
"Non alphanumeric characters are not allowed."
currencyViolationMessage
=
"You have entered an invalid currency."
emailAddressViolationMessage
=
"You have entered an invalid email address."
integerViolationMessage
=
"You have entered an invalid integer."
interneturlviolationmessage
=
"You have entered an invalid URL."
maxLengthViolationMessage
=
"Too long"
maxValueViolationMessage
=
"Too big"
messageCssClass
=
"sfError"
messageTagName
=
"div"
minLengthViolationMessage
=
"Too short."
minValueViolationMessage
=
"Too small."
nonAlphaNumericViolationMessage
=
"Alphanumeric characters are not allowed."
numericViolationMessage
=
"You have entered an invalid number."
percentageViolationMessage
=
"You have entered an invalid percentage."
regularExpressionViolationMessage
=
"Invalid format"
requiredViolationMessage
=
"This information is required"
usSocialSecurityNumberViolationMessage
=
"You have entered an invalid US social security number."
usZipCodeViolationMessage
=
"You have entered an invalid US ZIP code."
validateIfInvisible
=
"True"
/>
</
field
>
</
fields
>
<
expandableDefinition
expanded
=
"True"
/>
</
sections
>
</
sections
>
</
view
>