One problem I recently encountered myself is one that I see appearing every so
often on the DotNetNuke forums. I was working with profile properties and I set
a property as required but accidentally forgot to set it to visible. I then
proceeded to update the preferences that require a valid profile for login. I
am now effectivly locked out of my site as I did not have that property set for
my host or admin account. In this article I will provide you the information
needed to reset the custom properties and to get you back into your site.
AssumptionsAs I provide the needed SQL Queries I am going to assume that you are working
with a portal that has the id of 0 if you are working with a portal other than
portal 0 you will need to modify all applicable scripts to ensure that you
modify the proper data values. Also please note that you are using these queries at your own risk and that I am
not liable for any data loss that might occur. Gather InformationBefore we execute the update script we should run the below script. This will
identify the profile properties that we will be modifying when we perform the
actual fix for this issue.
SELECT PropertyName,
PropertyCategory FROM profilepropertydefinition WHERE PortalId = 0
AND Deleted = 0
AND Required = 1
AND Visible = 0 In this query we are simply looking for any profile properties that are marked
as required, are not visible, and exist in our current portal. This query will
show you ALL properties that will be updated with the "Fix" script that will
follow later in this article. Perform the FixThe process of fixing this issue is very simple, I personally prefer to simply
update the visibility on the newly required fields to ensure that they will
show. You have other options as well but I see this as the least involved
method and the least likely to affect other areas of the site. As long as all
information looked ok from the "Gather Information" step you may execute the
below script to fix the records. UPDATE Profilepropertydefinition SET Visible = 1 WHERE PortalId = 0
AND Deleted = 0
AND Required = 1
AND Visible = 0 Now that you have ran this script you should be able to login and provide the
needed profile elements. If you are still unable to see the fields, you will
need to trigger an application restart. This can be done by adding a space to a
non-critical portion of your web.config and saving the change. I hope this article has been able to help you get back into your portal if you
were locked out. Please share you comments and concerns below. |