Copied to clipboard

Flag this post as spam?

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


  • Niels Lynggaard 192 posts 550 karma points
    Jun 07, 2018 @ 13:18
    Niels Lynggaard
    0

    User is logged outwhen inserting richtext

    I have a really wierd issue. I installed this package and my user (admin) can insert this type of field ok.

    BUT! The editor of the site is kicked/logged out when he tries to insert the RTE field. I tested this locally with his user, and the result is the same. Once he chooses the RTE he is logged out immediatly. (forms 6.0.5)

    Any ideas on where to look for this error? He is an editor with permissions set up on the for. He has no access to prevalue-sources and datasources, but I don't think that has to do with this.

    Looks like som kind of permission-error, maybe? The log doesn't seem to show anything related to this.

    Thanx for this excellent package.

    /Niels

  • Matthew Wise 271 posts 1373 karma points MVP 5x c-trib
    Jun 07, 2018 @ 13:26
    Matthew Wise
    100

    Hi Niels,

    Yes, I found this recently as well with one of our clients. I just haven't got round to fixing the issue.

    If you create a controller as below

    [PluginController("UmbracoApi")]
        [Authorize]
        public class FormsDataTypeApiController : BackOfficeNotificationsController
        {        
            public DataTypeDisplay GetByName(string name)
            {
                var dataType = Services.DataTypeService.GetDataTypeDefinitionByName(name);
                return dataType == null ? null : Mapper.Map<IDataTypeDefinition, DataTypeDisplay>(dataType);
            }
        }
    

    And update the App_plugins/MwUmbForms.Rte/rte.controller.js to

    (function () {
        function mwRteController($scope, $http) {
            "use strict";
            $scope.htmfield = [];
            $http.get('/umbraco/backoffice/UmbracoApi/FormsDataTypeApi/GetByName/?name=Form RTE').then(function (res) {
                var d = res.data
                $scope.htmfield = [{
                    alias: "htmfield",
                    label: "Html",
                    view: "rte",
                    config: {
                        editor: d.preValues[0].value
                    },
                    value: $scope.setting.value
                }];
                $scope.$watch("htmfield", function () {
                    if ($scope.htmfield != undefined) {
                        $scope.setting.value = $scope.htmfield[0].value;
                    }
                }, true);
            });
        }
        angular.module("umbraco").controller("mw.umbFormsRteController", mwRteController);})();
    

    I will try and get the above fixed release soon.

    Matt

  • Niels Lynggaard 192 posts 550 karma points
    Jun 07, 2018 @ 13:31
    Niels Lynggaard
    1

    Thank, Matt!

    I'll give it a go!

    /Niels

    Update: Works like a charm!

Please Sign in or register to post replies

Write your reply to:

Draft