jpatokal / openflights

Website for storing flight information, rendering paths on a zoomable world map and calculating statistics, with plenty of free airline, airport and route data.
http://openflights.org
GNU Affero General Public License v3.0
1.37k stars 387 forks source link

Notes field does not clear when you navigate with < > in flight editor mode #1452

Closed reevery closed 7 months ago

reevery commented 7 months ago

Hi. I was editing some flights today using the GUI. I noticed that when you start with a flight with notes, then navigate to the previous or next using the navigation buttons < or >, the notes field does not clear. That means, if you save the next flight, you save the notes from the previous flight to every other until you notice.

reedy commented 7 months ago

It's not just </>; if you click edit on one, exit, and then edit on another that doesn't have a note set... that note will also load...

reedy commented 7 months ago

I suspect the issue is related to this:

  if(col[16] != "") {
    $('note').style.color = '#000';
    form.note.value = col[16];
  } else {
    $('note').value = $('note').hintText;
  }

The else case was removed when doing some refactoring of the hinted text boxes. In the old version, if the column from the DB was not "", we set the text, falling back to the hint text. This isn't needed now, so we don't clear the state properly... Easily fixed at least.