Just a short one today...

I happened to be researching Object Validations and I saw an interesting note posted here: https://learn.liferay.com/w/dxp/liferay-development/objects/creating-and-managing-objects/validations/adding-field-validations#using-groovy-validations

To quote (in case the content gets changed):

IMPORTANT

As of DXP 2024.Q2/Portal 7.4 GA120, scripting is disabled by default. You can enable it in System Settings → Script Management (under the Security category).

So this is not a big deal if you're on Liferay SaaS because you should already be aware that you cannot use Groovy...

But this will be a possibly big impact if you're on Liferay PaaS or Self Hosted. When you upgrade to 2024 Q2, you may need to enable Groovy just after updating.

How do you know if you need to enable Groovy?

Well, you will need to if you are currently doing any of the following:

Running Groovy scripts in the Scripting Control Panel, specifically scripts that you have written or if you are given a script to execute by Liferay Support.

If you are using Groovy in Workflows to handle status changes, issue notifications, change assigned workflow users/groups/rolls, or if you have any complex Workflow logic. The easiest way to check this is to actually look at the source view of your workflow script and search for "groovy"; if you find an instance, you'll find the Groovy script near it (typically below).

If you are using Groovy in Object validation or action scripts. Validations are easy to check, in the validation list for the object you'll find entries with Groovy in the Type column. Actions are a little more work to check, you have to click into each one and go to the Advanced tab and then check for Groovy as the Action for the instance.

Additionally if you have any customizations which themselves leverage the Liferay Scripting APIs for some reason. This is likely very rare; if you don't know that you have a customization that uses these APIs, you're more than likely not using them.

So why is Liferay doing this?

i don't really have any insight there, but I'm guessing it is to dissuade folks from using Groovy so it is easier to move onto the Liferay SaaS platform... Since Groovy is not available in SaaS, if you use Groovy in your Liferay PaaS or Self Hosted solution, this would become a blocker for possibly moving to Liferay SaaS. With Groovy disabled by default across all platforms, migrating onto Liferay SaaS is easier.

Anyways, this message caught me by surprise, and I figure it would catch others by surprise also.

At least now you know about it too and you even know how to turn it back on and how to check (in advance) if this is going to affect you or not.

Update:

So I did some digging, and actually the interface for the configuration is https://github.com/liferay/liferay-portal/blob/master/modules/apps/portal-security/portal-security-script-management-api/src/main/java/com/liferay/portal/security/script/management/configuration/ScriptManagementConfiguration.java, and there's also an associated upgrade process, https://github.com/liferay/liferay-portal/blob/master/modules/apps/portal-security/portal-security-script-management-web/src/main/java/com/liferay/portal/security/script/management/web/internal/upgrade/v1_1_0/ScriptManagementConfigurationUpgradeProcess.java. The upgrade process determines if the environment already uses Groovy in the places I mentioned and might update the default to keep it enabled.

So it looks like the configuration will be set correctly for you, but I would encourage you to double-check the setting after updating to ensure it matches your expectations.