Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOC entry not expanded. #2186

Closed
tigran123 opened this issue Jul 25, 2016 · 6 comments
Closed

TOC entry not expanded. #2186

tigran123 opened this issue Jul 25, 2016 · 6 comments

Comments

@tigran123
Copy link
Member

  • KOReader version: v2015.11-549
  • Device: Kobo Aura H2O

Issue

With multi-level hierarchical Table of Contents (aka "outlines" or "bookmarks") sometimes the last entry (on the top level) is not expanded when you touch the arrow/triangle.

Steps to reproduce

Open this PDF file:

http://www.bibles.org.uk/Revelation-Text-7in.pdf.zip

and try expanding "PART IV: LIFE AND TEACHINGS OF JESUS". No matter how many times I touch it, it doesn't expand. But PART I, II and III all expand correctly down to the lowest level. Very strange. Needless to say, there is nothing wrong with the PDF file --- PART IV is expanded correctly in various other programs I tried (e.g. evince and Adobe Acrobat). Also, it was expanding correctly in older versions of Koreader, so this is a bug introduced recently. Btw, the line "PART IV...." does change the colour when you touch the arrow, but the content is not expanded.

@tigran123 tigran123 added the bug label Jul 25, 2016
@tigran123
Copy link
Member Author

Btw, if one reaches the corresponding pages via some other means (e.g. hyperlinks or directly "Page Goto") then the corresponding top-level entry becomes expandable again. Curiouser and curiouser...

@Eduardomb22
Copy link

I can´t get the expanded name at OPDS links neither. If the name is longer than the screen size if I click >> it will not expand.

@houqp houqp added this to the next stable release milestone Jul 26, 2016
@tigran123
Copy link
Member Author

Also, very interestingly, if I do this, then TOC is expandable again:

  1. Delete the .sdr directory corresponding to this book
  2. Delete the files koreader/cache/*.

Now restart Koreader and, behold, Part IV entry in TOC is expandable! Ah, I have violated the ancient rule of testing --- change only ONE thing at a time and did the above TWO things. So, now we still don't know --- is it the cache files or the the .sdr metadata which affected the TOC expansion...

@tigran123
Copy link
Member Author

tigran123 commented Jul 26, 2016

Trying to reproduce it in the emulator, but I can't. Namely, in the emulator the TOC is expandable without any problem.

Btw, pressing the key Y in the TOC list in emulator crashes Koreader like this:

./luajit: frontend/apps/reader/modules/readertoc.lua:336: attempt to index local 'pos' (a nil value)
stack traceback:
    frontend/apps/reader/modules/readertoc.lua:336: in function 'onMenuSelect'
    frontend/ui/widget/menu.lua:735: in function 'handleEvent'
    frontend/ui/widget/container/widgetcontainer.lua:75: in function 'propagateEvent'
    frontend/ui/widget/container/widgetcontainer.lua:87: in function 'handleEvent'
    frontend/ui/uimanager.lua:389: in function 'sendEvent'
    frontend/ui/uimanager.lua:36: in function '__default__'
    frontend/ui/uimanager.lua:655: in function 'handleInput'
    frontend/ui/uimanager.lua:694: in function 'run'
    ./reader.lua:172: in main chunk
    [C]: at 0x00404750

The Y key corresponded to the Part IV entry in the TOC top level. I forgot to mention that it crashes in the same way (on the emulator) by pressing any other keyboard shortcut corresponding to the top level TOC entries. But pressing the keyboard shortcut for other levels works, i.e. jumps to the corresponding page correctly.

@tigran123
Copy link
Member Author

Ok, I have proved that it is nothing to do with deleting the cache but definitely to do with deleting .sdr directory. Namely, I have deleted it again and opened the file --- TOC is expandable. Then exited Koreader and re-started it and opened the same file via History --- TOC is NOT expandable and I get this in crash.log:

warning: undefined link destination

Hzj-jie added a commit that referenced this issue Jul 30, 2016
This issue has been mentioned in #2186.
@tigran123
Copy link
Member Author

Tested with the build 558 and TOC is expandable correctly. So, closing the issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants