Issue
After updating our fix pack level, all publications in flight are outdated.
Steps to reproduce the issue:
- Add new Publication called "lmp_excel_upd"
- Update Web Content in that Publication "lmp_excel_upd" for review, do not publish these changes.
- Upgrade to a newer version, that Publication "lmp_excel_upd" status becomes "OUT OF DATE"
Environment
- DXP 7.4
Resolution
We have a groovy script which can be used to resolve this issue.
Then, you can run it from Control Panel > Server Administration > Script
// This script updates the schema version id of the given CT collection. This is
// to be used as a workaround when a CT collection becomes out of date.
// The script contains two adjustable variables on lines 22 and 23: companyId
// and ctCollectionId. Please adjust them to point to the desired CT Collection.
import com.liferay.change.tracking.model.CTCollection;
import com.liferay.change.tracking.model.CTSchemaVersion;
import com.liferay.change.tracking.service.CTCollectionLocalServiceUtil;
import com.liferay.change.tracking.service.CTSchemaVersionLocalServiceUtil
import com.liferay.portal.kernel.security.auth.CompanyThreadLocal;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
import java.util.HashMap;
import java.util.Map;
final long companyId = 42637;
final long ctCollectionId = 602;
long oldCompanyId = CompanyThreadLocal.getCompanyId();
try {
CompanyThreadLocal.setCompanyId(companyId);
CTCollection ctCollection = CTCollectionLocalServiceUtil.getCTCollection(
ctCollectionId);
CTSchemaVersion ctSchemaVersion =
CTSchemaVersionLocalServiceUtil.getLatestCTSchemaVersion(companyId);
ctCollection.setSchemaVersionId(ctSchemaVersion.getSchemaVersionId());
ctCollection.setStatus(WorkflowConstants.STATUS_DRAFT);
CTCollectionLocalServiceUtil.updateCTCollection(ctCollection);
out.println(
"Successfully updated schema version of CT collection " +
ctCollectionId);
}
finally {
CompanyThreadLocal.setCompanyId(oldCompanyId);
}
Additional Information