User Profile: Settings


  • Plugin & Theme Dev

    Can you suggest, what could be a problem of such setting page in user profile.
    Many empty div.className = well in the end of page.

    Screen Shot 2015-10-04 at 10.49.24 AM.png


  • Admin

    What theme are you using? I vaguely remember an issue like this earlier, just needed to update the template to latest


  • Plugin & Theme Dev

    Custom theme that is heavily based on Persona (Persona end of July - begin of August).
    In my theme I have edited only board and topic templates, I didn't edit User: Setting template.

    What do you mean by update template to latest ?


  • Admin

    Are you using the filter filter:user.settings or something similar? That page uses one of those hooks to add additional settings into the page.


  • Plugin & Theme Dev

    @baris said:

    filter:user.settings

    I don't remember if I use such hook, I think, I don't.
    Just a small check:

    $ grep -rnw 'filter:user.settings'
    src/controllers/accounts.js:413:			plugins.fireHook('filter:user.settings', {settings: results.settings, customSettings: [], uid: req.uid}, next);
    

  • Admin

    Can you go to api/user/<username>/settings and post the output?


  • Plugin & Theme Dev

    {
        _key: "user:1",
        username: "Nicolas",
        userslug: "nicolas",
        uid: 1,
        yourid: 1,
        theirid: 1,
        isSelf: true,
        showHidden: true,
        profile_links: [],
        settings: {
            groupTitle: "administrators",
            showemail: false,
            showfullname: false,
            openOutgoingLinksInNewTab: true,
            dailyDigestFreq: "week",
            usePagination: false,
            topicsPerPage: 20,
            postsPerPage: 20,
            notificationSounds: false,
            userLang: "en_GB",
            topicPostSort: "oldest_to_newest",
            categoryTopicSort: "newest_to_oldest",
            followTopicsOnCreate: true,
            followTopicsOnReply: true,
            sendChatNotifications: true,
            sendPostNotifications: true,
            restrictChat: false,
            topicSearchEnabled: true,
            bootswatchSkin: "default"
        },
        languages: [],
        userGroups: [{
            _key: "group:overseers",
            name: "overseers",
            slug: "overseers",
            createtime: 1443674096394,
            userTitle: "Overseers",
            description: "",
            memberCount: 138,
            deleted: "0",
            hidden: false,
            system: false,
            private: true,
            ownerUid: 1,
            icon: "fa-eye",
            labelColor: "#4caf4f",
            userTitleEnabled: true,
            createtimeISO: "2015-10-01T04:34:56.394Z",
            cover: url: "/images/cover-default.png",
            cover: position: "50% 50%",
            nameEncoded: "overseers",
            displayName: "overseers",
            members: [],
            truncated: true,
            selected: false
        }, {
            _key: "group:founders",
            name: "founders",
            slug: "founders",
            createtime: 1443674096394,
            userTitle: "Founders",
            description: "",
            memberCount: 29,
            deleted: "0",
            hidden: false,
            system: false,
            private: true,
            ownerUid: 1,
            icon: "fa-eye",
            labelColor: "#388e3d",
            userTitleEnabled: true,
            createtimeISO: "2015-10-01T04:34:56.394Z",
            cover: url: "/images/cover-default.png",
            cover: position: "50% 50%",
            nameEncoded: "founders",
            displayName: "founders",
            members: [],
            truncated: true,
            selected: false
        }],
        customSettings: [],
        disableEmailSubscriptions: false,
        dailyDigestFreqOptions: [{
            value: "off",
            name: "[[user:digest_off]]",
            selected: false
        }, {
            value: "day",
            name: "[[user:digest_daily]]",
            selected: false
        }, {
            value: "week",
            name: "[[user:digest_weekly]]",
            selected: true
        }, {
            value: "month",
            name: "[[user:digest_monthly]]",
            selected: false
        }],
        bootswatchSkinOptions: [{
            name: "Default",
            value: "default",
            selected: true
        }, {
            name: "Cerulean",
            value: "cerulean",
            selected: false
        }, {
            name: "Cosmo",
            value: "cosmo",
            selected: false
        }, {
            name: "Cyborg",
            value: "cyborg",
            selected: false
        }, {
            name: "Darkly",
            value: "darkly",
            selected: false
        }, {
            name: "Flatly",
            value: "flatly",
            selected: false
        }, {
            name: "Journal",
            value: "journal",
            selected: false
        }, {
            name: "Lumen",
            value: "lumen",
            selected: false
        }, {
            name: "Paper",
            value: "paper",
            selected: false
        }, {
            name: "Readable",
            value: "readable",
            selected: false
        }, {
            name: "Sandstone",
            value: "sandstone",
            selected: false
        }, {
            name: "Simplex",
            value: "simplex",
            selected: false
        }, {
            name: "Slate",
            value: "slate",
            selected: false
        }, {
            name: "Spacelab",
            value: "spacelab",
            selected: false
        }, {
            name: "Superhero",
            value: "superhero",
            selected: false
        }, {
            name: "United",
            value: "united",
            selected: false
        }, {
            name: "Yeti",
            value: "yeti",
            selected: false
        }],
        disableCustomUserSkins: true,
        title: "[[pages:account/settings]]",
        breadcrumbs: [{
            text: "[[global:home]]",
            url: "/"
        }, {
            text: "Nicolas",
            url: "/user/nicolas"
        }, {
            text: "[[user:settings]]"
        }],
        loggedIn: true,
        relative_path: "",
        template: {
            name: "account/settings",
            account / settings: true
        }
    }
    

    I have excluded languages and members in group members.


  • Admin

    Weird customSettings is empty in the data as well.

    Those empty divs are created by https://github.com/NodeBB/nodebb-theme-persona/blob/master/templates/account/settings.tpl#L139-L144 not sure why you get them when the data is empty though.


  • Plugin & Theme Dev

    I have found the issue.
    Previously settings have been used for extra block creation, now it's customSettings
    Changing everything accordingly fixes issue.


 

| |