There are rare occasions when eCommerce catalog content cannot be checked using the workarea. For example, one user who is not available may have left content checked out but another user cannot check it back in.
When a content item cannot be checked back in using the workarea, use the SQL script below to return the content to "A" status. Warning: Use the script only on eCommerce content (products) (there are additional tables involved).
- Backup the database .
- Update the script with the target content_id and content_language by replacing the text TYPE_YOUR_CONTENT_ID and TYPE_YOUR_CONTENT_LANG with the actual IDs.
declare @content_id bigint;
declare @content_language int;
set @content_language = TYPE_YOUR_CONTENT_LANG - set to the language id
set @content_id = TYPE_YOUR_CONTENT_ID --Need to change this to the content that is having the problem
delete from approval_status_tbl where content_id=@content_id and content_language=@content_language
delete from approval_tbl where content_id=@content_id and content_language=@content_language
delete from save_meta_tbl where save_id in (select save_id from save_tbl where content_id=@content_id and content_language=@content_language )
delete from save_tbl where content_id=@content_id and content_language=@content_language
delete from edit_meta_tbl where content_id=@content_id and content_language=@content_language
delete from content_edit where content_id=@content_id and content_language=@content_language
update content set content_status='A' where content_id=@content_id and content_language=@content_language
update catalog_entry_tbl set entry_status='A' where entry_id=@content_id and entry_status_language=@content_language
UPDATE catalog_entry_version_tbl
SET history_id = (select top 1 history_id from content_history WHERE content_id =@content_id and content_status = 'A' order by history_id desc)
where entry_id = @content_id and audit_id =(select top 1 audit_id from catalog_entry_version_tbl where entry_id = @content_id order by audit_id desc)
UPDATE cms_audit_tbl
set status = 'A'
where audit_id = (select top 1 a.audit_id from cms_audit_tbl a INNER JOIN catalog_entry_version_tbl e ON a.audit_id = e.audit_id WHERE e.entry_id = @content_id AND a.status = 'O' order by created desc)
update entry_price_version_tbl
set priceid = (select priceid from entry_price_tbl where entryid = @content_id)
where entryauditid = (select top 1 audit_id from catalog_entry_version_tbl where entry_id = @content_id order by audit_id desc)
Please sign in to leave a comment.