Skip to content

Commit

Permalink
Merge pull request #4773 from effective-webwork/duplicate-process-titles
Browse files Browse the repository at this point in the history
Prevent duplicate process titles
  • Loading branch information
Kathrin-Huber authored Oct 20, 2021
2 parents 4f70af5 + 152b0ba commit 1a752ed
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.kitodo.production.enums.ObjectType;
import org.kitodo.production.helper.CustomListColumnInitializer;
import org.kitodo.production.helper.Helper;
import org.kitodo.production.process.ProcessValidator;
import org.kitodo.production.services.ServiceManager;
import org.kitodo.production.services.command.KitodoScriptService;
import org.kitodo.production.services.data.ProcessService;
Expand Down Expand Up @@ -179,6 +180,9 @@ public String save() {
* wenn der Vorgangstitel geändert wurde, wird dieser geprüft und bei
* erfolgreicher Prüfung an allen relevanten Stellen mitgeändert
*/
if (!ProcessValidator.isProcessTitleCorrect(this.newProcessTitle)) {
return this.stayOnCurrentPage;
}
if (Objects.nonNull(this.process) && Objects.nonNull(this.process.getTitle())) {
if (!this.process.getTitle().equals(this.newProcessTitle) && Objects.nonNull(this.newProcessTitle)
&& !renameAfterProcessTitleChanged()) {
Expand Down

0 comments on commit 1a752ed

Please sign in to comment.