In SharePoint 2010, you may find two ways the file upload in a library works based on whether you have custom required fields or not.
File upload in Document Library with no custom required field
By default when a library doesn’t have any required field, after uploading a document, the upload window redirects u to the library view page. So in this case there are two steps as shown below:
Figure 1: Two steps file upload process for library with not custom required fields
File upload in Document Library with custom required field
However, if you add a field as required then after uploading a document you will be shown an intermediate dialog window where you can provide values for required fields. The intermediate dialog is shown below:
Figure 2: For library with Required fields, user can see this dialog just after file upload
Now in this window you can enter values for required fields. But what if you don’t enter required field values and just cancel the dialog? In this case the file is checked out by you. You might expect that the dialog should be not canceled without entering required field values. But maybe SharePoint team just wanted to let the user to fill the required fields later on, without forcing to do so in the dialog immediately.
What if user leave the file checked-out by not entering values for required fields?
Now if user doesn’t fill the required fields on the dialog shown on figure 2 by clicking cancel button, then the file is not checked in and kept checked-out by the user who uploaded the file. Now if you select the ‘document’ item in library you can find the check-in button is enabled (shown in the image below) which means the document is checked-out.
Figure 3: File without filling required fields is checked-out
What if you try to check-in the file?
Now if you try to check-in the file by clicking “Check In” (as in figure 3), you will get an runtime exception as shown below:
Figure 4: Runtime exception on file check-in
What would be the expected behavior?
So what would be the expected behavior if user clicked on “Check In'” shown in figure 3? As I can expect that the window shown on figure 2 would be presented to let user know that the required fields are missing. So if user still cancels the dialog the file would be in checked-out state. If user put values for required fields and save then the file can be checked-in.