Input string was not in the correct format error message Appears Inside The Workarea

  • Updated

Upon loading up the workarea, you see an error message on the dashboard with the following message:

"input string was not in the correct format"

This message may also appear in the Event Viewer Application logs and will typically reference the ContentCheckedOut.ascx.cs file in the "Source File" section of the error. 

There's a number of potential reasons why this error occurs but most frequently it seems to appear when a user backs out of a checked out piece of content.

Under certain circumstances, even when the content is published/checked in, there is an issue where it isn't updated in the same status everywhere it needs to be in the database. This most commonly shows up in the checked out report in the dashboard.

PLEASE NOTE: Before running the following, it's strongly recommended that you make a database backup just in case there is an issue and you need to revert back. Once you've done that, please perform the following:

Step 1 should be run directly on the database for the website having the issue. Once the ID is returned from that query, you're going to plug it into step 3. What it will do is go through the database and update all instances of that content to status 'A' correcting any inconsistencies. 

Step 1.  
select c.content_id, c.content_status from content c left join content_edit ce on c.content_id = ce.content_id 

where ce.content_id is null and c.content_status != 'A' 

Step 2.  
It will return the ID or IDs for example: 20510 

Step 3. 
At this point, run the following query but with the correct IDs (note that this accounts for content in American English, 1033. Run once each with each language that needs to be accounted for): 

DECLARE @content_id bigint,@content_language INT 
SET @content_id=TYPE_YOUR_CONTENT_ID 
SET @content_language=1033 
DELETE FROM approval_status_tbl WHERE content_id=@content_id AND content_language=@content_language 
DELETE FROM approval_tbl WHERE content_id=@content_id AND content_language=@content_language 
DELETE FROM save_meta_tbl WHERE save_id in (select save_id FROM save_tbl WHERE content_id=@content_id AND content_language=@content_language ) 
DELETE FROM save_tbl WHERE content_id=@content_id AND content_language=@content_language 
DELETE FROM edit_meta_tbl WHERE content_id=@content_id AND content_language=@content_language 
DELETE FROM content_edit WHERE content_id=@content_id AND content_language=@content_language 
WAITFOR DELAY '00:00:05' 
UPDATE content SET content_status='A' WHERE content_id=@content_id AND content_language=@content_language 
GO