Revision: 30073
          http://sourceforge.net/p/bibdesk/svn/30073
Author:   hofman
Date:     2026-02-27 17:03:25 +0000 (Fri, 27 Feb 2026)
Log Message:
-----------
Don't allow recovering from error when the cleaned cite key would become invalid

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditor.m

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2026-02-27 16:18:17 UTC (rev 30072)
+++ trunk/bibdesk/BDSKEditor.m  2026-02-27 17:03:25 UTC (rev 30073)
@@ -2087,10 +2087,14 @@
                 
                 isValid = NO;
                 if (error) {
+                    errorCode = [publication canSetCiteKey:[obj 
stringByReplacingCharactersInSet:invalidSet withString:@""]];
+                    
                     NSError *err = [NSError 
mutableLocalErrorWithCode:kBDSKFailedToCommit 
localizedDescription:NSLocalizedString(@"Invalid Value", @"Message in alert 
dialog when entering an invalid value")];
                     [err setValue:NSLocalizedString(@"The cite key you entered 
contains characters that could be invalid in TeX. Do you want to keep them or 
remove them?", @"Informative text in alert dialog") 
forKey:NSLocalizedRecoverySuggestionErrorKey];
-                    [err setValue:self forKey:NSRecoveryAttempterErrorKey];
-                    [err setValue:@[NSLocalizedString(@"Remove", @"Button 
title"), NSLocalizedString(@"Keep", @"Button title")] 
forKey:NSLocalizedRecoveryOptionsErrorKey];
+                    if (errorCode == BDSKNoCrossrefError) {
+                        [err setValue:self forKey:NSRecoveryAttempterErrorKey];
+                        [err setValue:@[NSLocalizedString(@"Remove", @"Button 
title"), NSLocalizedString(@"Keep", @"Button title")] 
forKey:NSLocalizedRecoveryOptionsErrorKey];
+                    }
                     *error = err;
                 }
                 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to