Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-19911

Title of the page provided in the create form is replaced with first heading from file when creating a page as an office import

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 14.4.1
    • Office
    • Unknown

    Description

      Steps to reproduce

      • click create button to create a new page
      • fill in a title in the create form and choose the import from office option
      • upload an odt file with 3 sections, each one with a heading 1 title . Such a file is file TestTitleOnImport.odt attached to this issue
      • click import

      Expected result

      A page is created, with the following content:

      • the title chosen in the create form upon page creation
      • the 3 sections from the office file, preceeded by the heading 1 titles from the office file each

      Actual result

      A page is created, the 3 sections and their respective titles are present but, in addition,

      • the title of the page is actually the content of the first heading from the office file
      • However, the actual name of the page is the one filled in in the creation form:

      While this can be a happy guess in some cases, from the pov of coherence of the whole page creation operation it is rather incomprehensible as the title that the user has filled in is not respected.

      Attachments

        Issue Links

          Activity

            [XWIKI-19911] Title of the page provided in the create form is replaced with first heading from file when creating a page as an office import

            In order to fix this we need to:

            mflorea Marius Dumitru Florea added a comment - In order to fix this we need to: pass the page title from the Create step to the Office Importer UI ( XWiki.OfficeImporter ), here https://github.com/xwiki/xwiki-platform/blob/xwiki-platform-14.10.5/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/js/xwiki/create.js#L111 [optional] add a checkbox to chose whether to use the specified page title (default option) or the title extracted from the office document pass the page title from the Office Importer UI to the Office Importer Results ( XWiki.OfficeImporterResults ) pass the page title from the Office importer UI to the save call here https://github.com/xwiki/xwiki-platform/blob/xwiki-platform-14.10.5/xwiki-platform-core/xwiki-platform-office/xwiki-platform-office-ui/src/main/resources/XWiki/OfficeImporterResults.xml#L97 - #set ($result = $services.officeimporter.save($xdomOfficeDoc, $targetDocumentReference, $appendContent)) + #set ($result = $services.officeimporter.save($xdomOfficeDoc, $targetDocumentReference, $NULL, $title, $appendContent))
            mflorea Marius Dumitru Florea added a comment - - edited

            In an import with split it's not clear why we're even asking for a page title to the user in the create form since multiple pages will be created, what would that title be used for?

            There is always a "top level" / parent page created even when you choose to split the content of the imported office file. This is the target page you chose from the Create step, and it will contain links to the child pages (parts) generated by the split.

            mflorea Marius Dumitru Florea added a comment - - edited In an import with split it's not clear why we're even asking for a page title to the user in the create form since multiple pages will be created, what would that title be used for? There is always a "top level" / parent page created even when you choose to split the content of the imported office file. This is the target page you chose from the Create step, and it will contain links to the child pages (parts) generated by the split.
            ibalan Iulia Balan added a comment - - edited

            I reproduced the issue on XWiki Jetty HSQLDB 14.4.5:

            • I create a page importing Office document that contains headings styles and set a page title in the create form
            • after the import of the document the page title is changed to the first heading from the office document

            Thanks mflorea!

            Update: for my use case the split version is not selected. My issue is for the use case when you add the title of the page created importing a document with headings (with no split).

            ibalan Iulia Balan added a comment - - edited I reproduced the issue on XWiki Jetty HSQLDB 14.4.5: I create a page importing Office document that contains headings styles and set a page title in the create form after the import of the document the page title is changed to the first heading from the office document Thanks mflorea ! Update : for my use case the split version is not selected. My issue is for the use case when you add the title of the page created importing a document with headings (with no split).
            lucaa Anca Luca added a comment -

            To be checked together with XWIKI-18666 , as that issue is about title fetching from heading upon import with split.

            Currently, the behaviour seems to be the same on import with split and import without split (the import without split being a particular case of an import with split for n = 1), but the logic / UX of it may need to be reviewed. In an import with split it's not clear why we're even asking for a page title to the user in the create form since multiple pages will be created, what would that title be used for?

            lucaa Anca Luca added a comment - To be checked together with XWIKI-18666 , as that issue is about title fetching from heading upon import with split . Currently, the behaviour seems to be the same on import with split and import without split (the import without split being a particular case of an import with split for n = 1), but the logic / UX of it may need to be reviewed. In an import with split it's not clear why we're even asking for a page title to the user in the create form since multiple pages will be created, what would that title be used for?

            People

              Unassigned Unassigned
              lucaa Anca Luca
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: