NATION

PASSWORD

Dossier Bug?

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
Quebecshire
Ambassador
 
Posts: 1914
Founded: Mar 17, 2017
Democratic Socialists

Dossier Bug?

Postby Quebecshire » Sat Jul 02, 2022 2:57 pm

Sorry if this has already been brought up, but essentially, whenever I go to dossier a nation that has ceased to exist (through the button to do so on the boneyard page), it tells me I have failed a security check and does not go through. I've been able to get around this and dossier by using the upload feature for the advanced dossier, but since some other people off-site mentioned having the same issue, I figured I would raise it.

Is this a bug, or is there something I'm doing that's causing it?
PATRIOT OF THE LEAGUE REDEEMER OF CONCORD
Defender Moralist | Consul of the LDF | Warden-Lieutenant Emeritus | Commended
Benevolent Thomas wrote:I founded a defender organization out of my dislike of invaders, what invading represents, and my desire to see them suffer.
Pergamon wrote:I must say, you are truly what they deserve.

User avatar
Jar Wattinree
Ambassador
 
Posts: 1700
Founded: Dec 14, 2016
Psychotic Dictatorship

Postby Jar Wattinree » Sat Jul 02, 2022 3:27 pm

I'll add that while you can dossier nations that are alive, and remove both CTE and alive nations from your dossier, it says "This request failed a security check" if you try and dossier a CTE nation.
By the Holy Flaming Hammer of Unholy Cosmic Frost
I will voyage 'cross the Multiverse to fight for what was lost!
From this realm of nuclear chaos, to a world beyond the stars
I will quest forever onwards, so far;
I will wield the Holy Hammer of Flame!
Unholy cosmic frost!

Ecce Princeps Dundonensis Imperator Ascendit In Astra Eterna!

User avatar
Roavin
Admin
 
Posts: 1777
Founded: Apr 07, 2016
Democratic Socialists

Postby Roavin » Sat Jul 02, 2022 4:38 pm

Quebecshire wrote:Is this a bug, or is there something I'm doing that's causing it?


It's a bug. The Tampermonkey script below fixes it - all you have to do is visit a (live) nation page once with the script, and then you can dossier CTE'd nations. The script should be smart enough to be dormant when the bug is fixed.

@Admin: boneyard's dossier form is missing the chk input.

Code: Select all
// ==UserScript==
// @name         NS: Fix buggy nation dossiers
// @description  Adds missing "chk" inputs for forms
// @namespace    http://tampermonkey.net/
// @version      0.1
// @author       Roavin
// @match        https://www.nationstates.net/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=nationstates.net
// @grant        GM_getValue
// @grant        GM_setValue
// ==/UserScript==

(function() {
    'use strict';

    // if the page includes a chk code, store it
    var chkElement = document.querySelector("input[name='chk']");
    if (chkElement !== null) {
        GM_setValue("chk", chkElement.value);
    }

    // search for relevant forms that may be buggy
    var forms = document.querySelectorAll("form[action='page=dossier']");
    forms.forEach(form => {
        // does it have a chk input field?
        var chkElement = form.querySelector("input[name='chk']");
        if (chkElement == null) {
            // it does not - add it!
            var elm = document.createElement("input");
            elm.type = "hidden";
            elm.name = "chk";
            elm.value = GM_getValue("chk");
            form.appendChild(elm);
        }
    });
})();
Last edited by Roavin on Sat Jul 02, 2022 4:46 pm, edited 1 time in total.
Helpful Resources: One Stop Rules Shop | API documentation | NS Coders Discord
About me: Longest serving Prime Minister in TSP | Former First Warden of TGW | aka Curious Observations

Feel free to TG me, but not about moderation matters.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Sun Jul 03, 2022 3:22 pm

Quebecshire wrote:whenever I go to dossier a nation that has ceased to exist (through the button to do so on the boneyard page), it tells me I have failed a security check and does not go through.

Now fixed, thanks for the report.

User avatar
Jar Wattinree
Ambassador
 
Posts: 1700
Founded: Dec 14, 2016
Psychotic Dictatorship

Postby Jar Wattinree » Sun Jul 03, 2022 5:24 pm

[violet] wrote:
Quebecshire wrote:whenever I go to dossier a nation that has ceased to exist (through the button to do so on the boneyard page), it tells me I have failed a security check and does not go through.

Now fixed, thanks for the report.

Many thanks.
By the Holy Flaming Hammer of Unholy Cosmic Frost
I will voyage 'cross the Multiverse to fight for what was lost!
From this realm of nuclear chaos, to a world beyond the stars
I will quest forever onwards, so far;
I will wield the Holy Hammer of Flame!
Unholy cosmic frost!

Ecce Princeps Dundonensis Imperator Ascendit In Astra Eterna!


Return to Technical

Who is online

Users browsing this forum: Barbartopia, Geopolity, Giovanniland, Haku, Hulldom, Land Without Shrimp, North American Imperial State, Romanum et Britannia Minor, Saelmstica, Sluckyoma, Spoona, Tamocordia, Thaideland, The United Esto-Socialist People

Advertisement

Remove ads