legacy-knowledge-base
公開されました Jun. 30, 2025

パッチ適用後、処理中の公開はすべて古くなります。

written-by

Debora Vita

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

フィックスパックレベルを更新した後、飛行中のすべての出版物が古くなりました。

この問題を再現するための手順

  1. "lmp_excel_upd"という名前の新しい公開を追加します。
  2. レビューのため、公開 "lmp_excel_upd "へ新規Webコンテンツを更新します。これらの変更は公開しないでください。
  3. 新しいバージョンにアップグレードすると、公開 "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);
}


追加情報

LPS-173411

 

did-this-article-resolve-your-issue

legacy-knowledge-base