0

We have a problem with the "Discard a check-out" option in ribbon.

The user checks out a page and without editing anything in the page, wants to discard the page by clicking the button which is placed "Files > Discard Checkout"

However, the button is disabled.

The user can edit, delete, check in or publish the page, but this option is disabled.

if the users goes to document library where the file is saved and click the (...) button which opens a context menu, the "Discard a check-out" option there enabled and the page can be discarded.

Why is this option in ribbon disabled?

Tolga
  • 247
  • 1
  • 4
  • 10

1 Answers1

0

I've recently had the same problem. We have been using a custom permission level to let content editors do some custom stuff in SP 2010. When we migrated into SP 2013, the "Discard check-out" option in the ribbon got grayed out.

It turned out that user should have "View Versions" permission to return to previous version (obviously!). So I've added View Versions to our custom permission set. That solved my issue.

Further, SP.Ribbon.Debug.Js has following lines, but this would probably effect the 'visibility' of the menu item, not the 'greyness', still you should check to see if conditions are met :

SP.Ribbon.PageState.Handlers.isDiscardCheckoutEnabled = function SP_Ribbon_PageState_Handlers$isDiscardCheckoutEnabled() {
    if (SP.Ribbon.PageState.ImportedNativeData.PageState['ItemHasCheckedInVersion'] && !SP.Ribbon.PageState.ImportedNativeData.PageState['ItemIsFormsPage'] && SP.Ribbon.PageState.ImportedNativeData.PageState['ItemIsInSharedView'] && !SP.Ribbon.PageState.ImportedNativeData.PageState['ItemIsCheckedOutToOtherUser'] && SP.Ribbon.PageState.ImportedNativeData.PageState['ItemIsCheckedOutToCurrentUser']) {
        return true;
    }
    return false;
};
Guclu
  • 142
  • 11