Viewing page crashes if Content Workflow involved a user who has subsequently been deleted

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
1/27/2023 4:41:19 AM
Gravatar
Total Posts 128

Viewing page crashes if Content Workflow involved a user who has subsequently been deleted

Running mojoPortal 2.6.0.0 on MSSQL

ContentWorkflow references a user who has subsequently been deleted. A row in mp_ContentWorkflow has a userguid that dien't exist in mp_Users. The page cannot be loaded, with this in System Log:

2023-01-27 10:17:18,211 ERROR xx.xxx.xx.xxx - en-GB - /mypage - mojoPortal.Web.Global -  Referrer(https://mysite.com/Admin/ModulePermissions.aspx?pageid=734&mid=800&p=v) useragent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 Edg/109.0.1518.69 
System.InvalidCastException: Object cannot be cast from DBNull to other types.
   at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider)
   at mojoPortal.Business.ContentWorkflow.PopulateFromReader(IDataReader reader)
   at mojoPortal.Business.ContentWorkflow.GetWorkInProgress(Guid moduleGuid)

1/27/2023 8:17:31 AM
Gravatar
Total Posts 2253

Re: Viewing page crashes if Content Workflow involved a user who has subsequently been deleted

Hi Crispin,

I've run into this before and found a work-around. I think setting the workflow dropdown from "Work in Progress" to "Live Content" on another page, then browsing to the page will allow you to see it and click the edit link on the content with a draft.

Another solution would be to replace the userguid on the draft content with an existing userguid. 

I will take a look at our source code to see if we've fixed this yet, and if not, I'll fix it.

Thanks,
Joe

You must sign in to post in the forums. This thread is closed to new posts.