unfoldingWord / gateway-translate

A tool for editing and translating text in USFM markup
MIT License
2 stars 3 forks source link

Bug: non-existent book included in array #86

Closed mandolyte closed 1 year ago

mandolyte commented 1 year ago

@superdav42 I thought that perhaps it was because "obs" was in the list. But I filtered it out. So the list starts at 66 elements. And at the point where I pick a repository, suddenly it has 67 elements in the array and the first one is spurious and is causing the "undefined" error to show in the console.

image

Here is the mods I made to the book selection list function:

export function bookSelectList(books = null) {
  if ( ! books) {
    books = Object.keys(BIBLE_AND_OBS).filter( (b) => b !== 'obs')
  }
  const _books = books.map(
    (bookId) => ({ id: bookId, name: BIBLE_AND_OBS[bookId] }),
  )
  console.log("books:",_books)
  return books.map(
    (bookId) => ({ id: bookId, name: BIBLE_AND_OBS[bookId] }),
  )
}
superdav42 commented 1 year ago

frt is coming from dcs https://qa.door43.org/api/v1/repos/search?owner=Es-419_gl&subject=Aligned+Bible%2CBible%2CHebrew+Old+Testament%2CGreek+New+Testament in the books field. And I think it get's it from the manifest https://qa.door43.org/Es-419_gl/es-419_glt/src/branch/master/manifest.yaml#L44 . Probably we should actually let gateway translate open usfm files like this which I'm guessing contains intro text for the whole bible. There could be other bookIds we can't predict and no reason to not let gateway-translate open them.