Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27073

Fix call to fetch favorites on dashboard after database initialization

    XMLWordPrintable

    Details

    • Release Notes Summary:
      The favorites folder is always initialized when browsing the dashboard for the first time.
    • Backlog priority:
      300
    • Sprint:
      l2it-11.1.7

      Description

      Scenario to reproduce

      1. start Nuxeo against an empty (MongoDB) database
      2. Log in
      3. Observe the following error in the logs
        2019-03-12 19:26:55,392 WARN  [CoreQueryDocumentPageProvider] Failed to execute query: SELECT * FROM Document where ecm:mixinType != 'HiddenInNavigation' AND ecm:currentLifeCycleState != 'deleted' AND collectionMember:collectionIds/* = ? ORDER BY dc:title, Lexical Error: Illegal character <?> at offset 149
        org.nuxeo.ecm.core.query.QueryParseException: Failed to execute query: SELECT * FROM Document where ecm:mixinType != 'HiddenInNavigation' AND ecm:currentLifeCycleState != 'deleted' AND collectionMember:collectionIds/* = ? ORDER BY dc:title, Lexical Error: Illegal character <?> at offset 149
        	at org.nuxeo.ecm.core.query.sql.parser.Scanner.scanError(Scanner.java:878)
        	at org.nuxeo.ecm.core.query.sql.parser.Scanner.next_token(Scanner.java:1319)
        	at java_cup.runtime.lr_parser.scan(lr_parser.java:335)
        	at java_cup.runtime.lr_parser.parse(lr_parser.java:563)
        	at org.nuxeo.ecm.core.query.sql.SQLQueryParser.parse(SQLQueryParser.java:43)
        	at org.nuxeo.ecm.core.query.sql.SQLQueryParser.parse(SQLQueryParser.java:52)
        	at org.nuxeo.ecm.core.storage.dbs.DBSSession.doQueryAndFetch(DBSSession.java:1501)
        	at org.nuxeo.ecm.core.storage.dbs.DBSSession.doQuery(DBSSession.java:1465)
        	at org.nuxeo.ecm.core.storage.dbs.DBSSession.query(DBSSession.java:1453)
        	at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase$DBSSessionInvoker.invoke(DBSRepositoryBase.java:492)
        	at com.sun.proxy.$Proxy63.query(Unknown Source)
        	at org.nuxeo.ecm.core.api.AbstractSession.query(AbstractSession.java:1182)
        	at org.nuxeo.ecm.core.api.AbstractSession.query(AbstractSession.java:1115)
        	at org.nuxeo.ecm.core.api.AbstractSession.query(AbstractSession.java:1108)
        	at org.nuxeo.ecm.platform.query.nxql.CoreQueryDocumentPageProvider.getCurrentPage(CoreQueryDocumentPageProvider.java:159)
        	at org.nuxeo.ecm.automation.core.util.PaginablePageProvider.<init>(PaginablePageProvider.java:43)
        	at org.nuxeo.ecm.automation.jaxrs.io.documents.PaginableDocumentModelListImpl.<init>(PaginableDocumentModelListImpl.java:49)
        	at org.nuxeo.ecm.restapi.server.jaxrs.search.QueryExecutor.queryByPageProvider(QueryExecutor.java:360)
        	at org.nuxeo.ecm.restapi.server.jaxrs.search.QueryExecutor.queryByPageProvider(QueryExecutor.java:319)
        	at org.nuxeo.ecm.restapi.server.jaxrs.search.SearchObject.doQueryByPageProvider(SearchObject.java:96)
        

      This is due to the fact that the call to http://localhost:8080/nuxeo/api/v1/automation/Favorite.Fetch to fetch the favorite container returns an empty response.
      The consequence is that this code from nuxeo-home.html

          this._fetchFavorite().then(function (favorite) {
            this.$.favoritesProvider.params = [favorite.uid];
            this.$.favoritesProvider.page = 1;
            this.$.favoriteDocs.fetch();
          }.bind(this)); 
      

      will set an empty parameter for favorite.uid, hence the error.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h