-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 7.10, 8.10, 9.2
-
Component/s: Nuxeo Drive
-
Release Notes Summary:Child sync roots are escaped when retrieved
-
Backlog priority:500
-
Sprint:nxfit 9.3.5
-
Story Points:3
- install nuxeo 7.10
- install nuxeo-drive add-on
- in the personal workspace create a document of type File, containing a quote
- modify the permissions of this document
- logs show the following stack trace:
2017-07-27 16:38:45,313 ERROR [http-bio-0.0.0.0-8080-exec-31] [org.nuxeo.ecm.core.event.impl.EventServiceImpl] Exception during nuxeoDriveFileSystemDeletionListener sync listener execution, continuing to run other listeners org.nuxeo.ecm.core.query.QueryParseException: Failed to execute query: SELECT * FROM Document WHERE ecm:mixinType = 'DriveSynchronized' AND ecm:currentLifeCycleState != 'deleted' AND ecm:path STARTSWITH '/default-domain/UserWorkspaces/Administrator/myFolder/truc/SOMEHWERE SOMETHING/mySuper'Quote', Syntax error: Invalid token <Quote> at offset 223 at org.nuxeo.ecm.core.query.sql.parser.parser.parseFailed(parser.java:519) at org.nuxeo.ecm.core.query.sql.parser.parser.unrecovered_syntax_error(parser.java:510) at java_cup.runtime.lr_parser.parse(lr_parser.java:601) at org.nuxeo.ecm.core.query.sql.SQLQueryParser.parse(SQLQueryParser.java:39) at org.nuxeo.ecm.core.query.sql.SQLQueryParser.parse(SQLQueryParser.java:48) at org.nuxeo.ecm.core.storage.sql.jdbc.NXQLQueryMaker.buildQuery(NXQLQueryMaker.java:281) at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.queryProjection(JDBCMapper.java:799) at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.query(JDBCMapper.java:736) at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
The issue is in NuxeoDriveFileSystemDeletionListener and Path:
protected List<DocumentModel> getChildSyncRoots(DocumentModel doc, CoreSession session) { String nxql = "SELECT * FROM Document WHERE ecm:mixinType = '" + NuxeoDriveManagerImpl.NUXEO_DRIVE_FACET + "' AND ecm:currentLifeCycleState != 'deleted' AND ecm:path STARTSWITH '" + doc.getPathAsString() + "'"; return session.query(nxql); }
The path retrieved by doc.getPathAsString() is unescaped.
- is related to
-
NXP-21941 Always exclude versions when querying for Drive synchronization roots
- Resolved