File>templates>Manage, click Import, choose a file; get warning: ‘Error importing the following templates…’ if the file exists already. Cause should be explained, with option to overwrite: ‘File exists; overwrite?’. (I hate software that says frustratingly ‘An error occurred.’)
I confirm it with Version: 7.0.0.0.alpha1+ (x64) Build ID: 0e5e935deb0527c64865cfcc53a0421e56b74b6f CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-GB Calc: CL Additional information: Error only appears if target of import is the same category. I think, it is more an enhancement than a bug. cc: Desing-Team for decision about expected result.
While I agree on useful and actionable error messages, I doubt there is a simple solution. In sfx2/source/doc/templatedlg.cxx OnTemplateImportCategory() the error message shows-up in any case of errors (it's possible to multi-select files).
(In reply to TorrAB from comment #0) > File>templates>Manage, click Import, choose a file; get warning: ‘Error > importing the following templates…’ if the file exists already. Agree with request, but situation is slightly more complicated. You can import a file with same filename as an existing template, if Title is different (File>Properties - Description tab - Title) (imported filename has '1' appended to it) Otoh, if imported file has same Title as existing template (with a different filename), then only one template is shown in Template Manager. iow, an attempt to improve error-checking feedback will involve a different process than checking filenames...
(In reply to sdc.blanco from comment #3) > Otoh, if imported file has same Title as existing template (with a different > filename), then only one template is shown in Template Manager. Correction: In this case, the title in the imported template file is removed, so that the filename becomes the template name. If there is already a template with the same Title as the filename being imported, then you get a "cannot import" message -- even if there is no filename with the same filename as the template to be imported. The bottom line conclusion remains the same: an attempt to improve error-checking feedback will involve a different process than checking filenames...
An alternative to error feedback would be "error correction" As the examples in comment 3 and comment 4 show, Template Manager already makes "silent" correction actions in some cases. For the "error" cases, a simple repair would be to offer the opportunity to enter a new name for the template. afaict, if the same name/title does not exist in the selected category, then the template manager already knows how to handle the clash with filenames. iow, with a "rename" function (instead of an error message), the need for giving "error" feedback messages could be completely eliminated -- because it would always be possible to successfully import templates. (after which, one could "rename", "delete", "move" templates within Template Manager as needed.)