[BUG] Default changeset comment does not load in new instance setup
ramyaragupathy opened this issue · 3 comments
Describe the bug
In the dev instance of Tasking Manager - defautl changeset comment does not load for any project. Not just it does not persist any of the inputs added to this field.
To Reproduce
Steps to reproduce the behavior:
- Go to https://tasks-dev.hotosm.org/
- Create a new project
- Then get to the edit section of the project.
- Default changeset comment field under
Instructions
is empty - Update the changeset comment with some custom value.
- Hit
save
the project - Project is updated successfully
- Now go to some other section like
Permissions
and then revisitInstructions
- Default changeset comment is empty, your input value is not updated.
Expected behavior
- Default changeset comment should auto populate for every project
- Any user inputs to the changeset comment should persist
Looks like the default changeset comment became mis-matched again
This has been fixed, can you confirm and close?
Not sure why they got mismatched, but I replaced the envvar in the CircleCI (frontend) context to match the backend, then re-deployed the frontend.
then I ran the following sql (thanks @ramyaragupathy ) on the server to reset the changeset fields that were undefined. Its not perfect because it deleted any additional comments that were added but worked for dev.
-- Fetch all project IDs in a temporary table
SELECT
projects.id
INTO TEMPORARY TABLE
temp_id
FROM
projects;
CREATE OR REPLACE FUNCTION update_comment()
RETURNS SETOF text AS
$func$
DECLARE
proj int;
BEGIN
FOR proj IN
SELECT * FROM temp_id
LOOP
update projects set changeset_comment = '#<default-comment>-'||proj where id = proj;
RETURN NEXT proj;
RAISE NOTICE 'Project: %', proj;
END LOOP;
END
$func$ LANGUAGE plpgsql;
SELECT * from update_comment();