Page unlock option not working

To fix this, you need to put a dependency on the clientlibs mentioned above to have it loaded for your custom content page.

Description description

Environment

Adobe Experience Manager (AEM)

Issue

When trying to lock/unlock a page via the page sidebar [ Image 1] , you are able to lock it. However, when you try to unlock it, an error [ Image 2] is thrown.

On the other hand, you are able to successfully lock/unlock the page via the site admin console [ Image 3] .

[ Image 1]

[ Image 2]

[ Image 3]

Resolution resolution

The error [ 1] when trying to unlock a page appears because the page doesn’t include the cq.shared client lib.

To fix this, you need to put a dependency on the clientlibs mentioned above to have it loaded for your custom content page.

[ 1]

core.lc-ca7bc91540b118cagaha6d0db684341c-lc.min.js:1039 Uncaught TypeError: Cannot read properties of undefined (reading 'shared')
at HTMLButtonElement.unlockPage (core.lc-ca7bc91540b118cagaha6d0db684341c-lc.min.js:1039:177)
at HTMLDocument.dispatch (jquery.lc-7842899024219bcbdb5gahc946870b79-lc.min.js:126:340)
at h.handle (jquery.lc-7842899024219bcbdb5gahc946870b79-lc.min.js:120:65)
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f