Issue
- I am having issues updating our object definitions via site initializer synchronization. The issue was first observed with new fields not getting added to objects. When I do a manual object definition export/add fields/import, it works, and I get the new fields; if I try it via site initializer, no fields get added.
Reproduction Steps:
1. Start 2025.q1.2-lts
2. Go to Control Panel --> Object --> Objects, and create an object (for example: ODLiferayTest1)
3. On its Field tab, add a field (OFLiferayText1)
4. Execute the attached CURL request with the provided JSON (I tested with Postman). Do not forget to replace the object ID with yours here: http://localhost:8080/o/object-admin/v1.0/object-definitions/57717
and the ERC with yours: "externalReferenceCode": "94dc9456-ce93-025c-84ea-be142a5c9b37",
curl -X 'PATCH' \
'http://localhost:8080/o/object-admin/v1.0/object-definitions/57717' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'x-csrf-token: 7xrI0KOQ' \
-d '{
"label": {
"en_US": "ODLiferayTest1_PATCHED"
},
"pluralLabel": {
"en_US": "ODLiferayTest1s_PATCHED"
},
"objectFields": [
{
"label": {
"en_US": "OFLiferayText1_PATCHED"
},
"externalReferenceCode": "94dc9456-ce93-025c-84ea-be142a5c9b37",
"name": "oFLiferayText1"
},
{
"DBType": "String",
"indexed": true,
"indexedAsKeyword": false,
"label": {
"en_US": "OFLiferayCode"
},
"name": "oFLiferayCode",
"type": "String",
"required": true,
"externalReferenceCode": "obj-code"
}
]
}'
Expected Result: The label and pluralLabel of the Object Definition are updated.
The label of the existing field (OFLiferayText1) is updated.
A new field (OFLiferayCode) is added.
Actual Result: The label and pluralLabel of the Object Definition are updated.
The Object Fields remain unchanged (no updates to OFLiferayText1, and OFLiferayCode is not added).
Environment
- Quarterly Release 2025.q1.2-lts
Resolution
- The current behavior is expected. Calling a patch to update nested structures (like object fields) is currently a product limitation. The Product Team is currently evaluating the case.
- A workaround to avoid this issue is to modify the nested structures or create new ones, we suggest creating the
object-fields
directory and placing the new fields there. Please see this example.