So I debugged and Googled around and went through a pretty large array of possible problems for why the allPortletsReady was not working for other people.
Some results suggested that the Related Assets portlet might cause the problem – That’s not the case this time though as I wasn’t using that portlet on my pages.
Next up on the list is Notifications Portlet and sure enough I had no Notification Portlet on those pages either.
Finding no obvious solutions using quick searches on Google and StackOverflow I decided to start testing and debugging. So I created a new clean page and added my portlet on that one. This time the portlet had it’s “allPortletsReady” event nicely firing so I now know that my portlet works on new and clean pages.
So by now we know that it works on clean new pages and does not work on old pages even after removing all portlets. I even tried switching themes which had no result.
Liferay allPortletsReady Solution (One of many)
Finally it dawned upon me – there has to be a difference on the pages between the new and old page – I checked the page’s embedded portlets section and discovered that even though I no longer had a Login portlet on those pages, they still had Liferay built-in Login portlet ID 58 listed there with some preferences saved. I removed those preferences and sure enough the allPortletsReady started firing again as normal.
Here’s a screenshot of the embedded portles section (I already removed the Login portlet from the list):
Solution: Remove old unused embedded portlet preferences from the page.
If you have a question or having trouble getting this thing working then feel free to write me a comment and I’ll do my best to help you out. If you would like to read more about Liferay related subjects then also make sure to comment on that and if you liked what you read then make sure to subscribe – It’s FREE!