hotosm / tasking-manager

Tasking Manager - The tool to team up for mapping in OpenStreetMap

Home Page:https://wiki.openstreetmap.org/wiki/Tasking_Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Default changeset comment does not load in new instance setup

ramyaragupathy opened this issue · 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:

  1. Go to https://tasks-dev.hotosm.org/
  2. Create a new project
  3. Then get to the edit section of the project.
  4. Default changeset comment field under Instructions is empty
  5. Update the changeset comment with some custom value.
  6. Hit save the project
  7. Project is updated successfully
  8. Now go to some other section like Permissions and then revisit Instructions
  9. Default changeset comment is empty, your input value is not updated.

Expected behavior

  1. Default changeset comment should auto populate for every project
  2. Any user inputs to the changeset comment should persist

Screenshots
image

changeset-comment

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();