Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Amri 214 posts 740 karma points
    Feb 06, 2019 @ 14:39
    David Amri
    0

    Current users' log history within custom dashboard

    When trying to get current users' log history within custom dashboard this error is thrown:

    An error occured There was an error parsing the query. [ Token line number = 4,Token line offset = 39,Token in error = WHERE ]

    Exception Details System.Data.SqlServerCe.SqlCeException: There was an error parsing the query. [ Token line number = 4,Token line offset = 39,Token in error = WHERE ]

    My model looks like this:

    angular.module("umbraco").controller("CustomWelcomeDashboardController", function ($scope, logResource) {
    
        var vm = this;
        logResource.getUserLog("save", new Date()).then(function (response) {
    
            console.log(response);
        });
    });
    

    I've tried and played around with a couple of different services and methods but almost always end up with some exception. Is the documentation trustworthy regarding these things? Or am I missing something?

    / David

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Feb 07, 2019 @ 22:54
    Marc Goodson
    0

    Hi David

    It depends a little on which version of Umbraco you are using.

    Unfortunately since the welcome dashboard tutorial was written there have been a couple of breaking changes to the logResource implementation of getUserLog, including a period of time where the SQL used to get the log of User activity was not compatible with SQL CE :-(

    If you are on the latest Umbraco version then getPagedUserLog is the new method that fixes all the problems and works with SQL CE too.

    logResource.getPagedUserLog(userLogOptions)
        .then(function (response) {
            console.log(response)
            vm.UserLogHistory = response;
        });
    

    regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft