問題
フィックスパックレベルを更新した後、飛行中のすべての出版物が古くなりました。
この問題を再現するための手順
- "lmp_excel_upd"という名前の新しい公開を追加します。
- レビューのため、公開 "lmp_excel_upd "へ新規Webコンテンツを更新します。これらの変更は公開しないでください。
- 新しいバージョンにアップグレードすると、公開 "lmp_excel_upd" のステータスが "有効期限切れ" になります。
環境
- DXP 7.4
解決
この問題を解決するために使用できるgroovyスクリプトを用意しています。
その後、コントロールパネル > サーバ管理 > スクリプトから実行します。
// 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);
}
追加情報