Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-8961

JCR import command fails when replacing existing nodes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 6.3.0, 6.2.39
    • 6.2.35
    • None
    • Yes
    • Yes
    • Nucleus 42, Nucleus 43
    • 5
    • Yes

    Description

      Steps to reproduce

      In demo author:

      1. Export an asset from dam app
      2. Open importer subapp of Jcr-Tools app
      3. Select dam repository, root path and behaviour: replace existing nodes with the same ID
      4. Press execute

      Expected results

      Node is imported correctly and replaced

      Actual results

      There is an error message: 

      javax.jcr.query.InvalidQueryException: Query:
      SELECT * FROM [nt:resource] WHERE(*); expected: NOT, (
      

      Development notes

      The query is not correctly generated in method info.magnolia.importexport.command.JcrImportCommand.validate(Node, Context, NodeIterator). The value of statement is: 

      SELECT * FROM [nt:resource] WHERE 

      It's assumed that there's always a where clause while there are some cases in which it's not the case. Adding an empty string check in line 118 will fix this issue.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                ajuran AntonĂ­n Juran
                jayala Jonathan Ayala
                Nucleus
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Work Started:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - Not Specified
                      Not Specified
                      Logged:
                      Time Spent - 3d 7h
                      3d 7h