Bug 143771 - FILTER: FILESAVE: When xml export xsl transform file not found, error message is vague and misleading: "Error saving document" "General input/output error"
Summary: FILTER: FILESAVE: When xml export xsl transform file not found, error message...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval
Depends on:
Blocks: Error-Messages
  Show dependency treegraph
 
Reported: 2021-08-07 14:20 UTC by gekacheka
Modified: 2023-10-06 05:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gekacheka 2021-08-07 14:20:33 UTC
Description:
When an xsl transform file for a custom export xml filter is not found,
and an export using the filter is performed, the error dialog message is 

  Error saving document (document filename):
  General Error
  General input/output error.

A much clearer error would specify the filter name, not document name, and specify that the transform path, not the document path, is the problem:

  Error loading XML Filter "(filtername)":
  File not found at: (xslt file path)





Steps to Reproduce:
Steps to reproduce:

1. Create an xsl file (such as \exportbug\copy.xsl that copies its input):

<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" indent="yes"/>
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:transform>

2. Add the custom xml filter to Calc
2.1 Tools (menu) / XML Filter Settings ...
2.2 General (tab)
2.2.1 Filter Name: Copy input xml
2.2.2 Application: LibreOffice Calc (.ods)
2.2.3 Name of file type: Copied Xml
2.2.4 File extension: xml
2.3 Transformation (tab)
2.3.1 XSLT for export: \exportbug\copy.xsl

3. Export file
3.1 File (menu) / Export ...
3.2 Export dialog
3.2.1 Save as type: Copied Xml (.xml)
3.2.2 click Save 
["Untitled 1.xml" file is saved, no error occurs.]

4. Outside LibreOffice, move or rename folder containing copy.xsl (for example, rename exportbug to exportbug1)

5. Repeat step 3.
[Error occurs.]


Actual Results:
Actual Error is vague and misleading:

  Error saving document Untitled 1:
  General Error
  General input/output error.


Expected Results:
Expected error specifies that the problem is loading the xslt file, not saving the document, and specifies the path not found.

  Error loading XML Filter "Copy input xml":
  File not found at: \exportbug\copy.xsl


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: SpreadsheetDocument

Version: 7.1.5.2 (x64) / LibreOffice Community
Build ID: 85f04e9f809797b8199d13c421bd8a2b025d52b5
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc:
Comment 1 Buovjaga 2022-05-19 10:35:39 UTC
Reproduced. Changing to enhancement as this is about improving the message. Adding needsDevEval as this might be an easy hack.

(In reply to gekacheka from comment #0)
> 2.1 Tools (menu) / XML Filter Settings ...

The path is now Tools - Macros - XML Filter Settings...

Arch Linux 64-bit
Version: 7.4.0.0.alpha1+ / LibreOffice Community
Build ID: 60addb6e864e1e8eb6c4ea7bb5be04a94a1ea7fb
CPU threads: 8; OS: Linux 5.17; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 19 May 2022