-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
I am fixing a couple of bugs here: - The unique_fields table is not getting clean up after deleting a ContentType - When try to update a Publish Contentlet with a unique fields but the unique fields is not changed ### Proposed Changes * Create a method to listen when a ContenType is deleted to clean up the unique_fields table https://github.com/dotCMS/core/pull/30872/files#diff-217758731836e15813d5ad2e85a398e4d52317cbbb9334d5961895f9d7883851R113 * Used the ContentTypeDeletedEvent to include the whole ContentType and not just the variable name, we are going to need the field list to know if this ContentType has unique fields later https://github.com/dotCMS/core/pull/30872/files#diff-b3de838f3681e084b3121056ed3a3002a19761e286f17a26ba8f466842b345a9R7 * The Unique value can be used by a LIVE or WORKING version, If the value for the LIVE and WORKING version are different then you are going to have a register for each but if the value is the same then you are going to have just 1 register for both with the LIVE equals true, so we when we clean uo the table after a update we need to check if the register that already exists are LIVE or WORKING https://github.com/dotCMS/core/pull/30872/files#diff-217758731836e15813d5ad2e85a398e4d52317cbbb9334d5961895f9d7883851R113-R137 --------- Co-authored-by: fabrizzio-dotCMS <[email protected]>
- Loading branch information
1 parent
4aaeb73
commit 6181061
Showing
9 changed files
with
506 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 10 additions & 4 deletions
14
dotCMS/src/main/java/com/dotcms/contenttype/model/event/ContentTypeDeletedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
package com.dotcms.contenttype.model.event; | ||
|
||
import com.dotcms.contenttype.model.type.ContentType; | ||
|
||
public class ContentTypeDeletedEvent { | ||
|
||
private final String contentTypeVar; | ||
private final ContentType contentType; | ||
|
||
public ContentTypeDeletedEvent(final String contentTypeVar) { | ||
this.contentTypeVar = contentTypeVar; | ||
public ContentTypeDeletedEvent(final ContentType contentType) { | ||
this.contentType = contentType; | ||
} | ||
|
||
public String getContentTypeVar() { | ||
return contentTypeVar; | ||
return contentType.variable(); | ||
} | ||
|
||
public ContentType getContentType() { | ||
return contentType; | ||
} | ||
} |
Oops, something went wrong.