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

[BUG] EnhancedJournal.renderSubSheet prefers stored options over supplied options. #451

Closed
farling42 opened this issue Dec 9, 2022 · 1 comment

Comments

@farling42
Copy link

Describe the bug
When used with PDF Pager, an explicit page passed in the options to the render function (options.anchor="page=12") are being overwritten by the stored anchor on the page.

The mergeObject call in renderSubSheet might benefit from having a third parameter , {overwrite:false} so that supplied options are preferred over stored options.

Certainly with the above third parameter the selected PDF page is correctly displayed in the embedded journal entry.

The suggestion is to change:

options = mergeObject(options, game.user.getFlag("monks-enhanced-journal", `pagestate.${this.object.id}`) || {});

to

options = mergeObject(options, game.user.getFlag("monks-enhanced-journal", `pagestate.${this.object.id}`) || {}, {overwrite:false});

To Reproduce
Steps to reproduce the behavior:

  1. Create a PDF within a journal entry
  2. Create a link within another journal entry to the created PDF page
  3. Add "#page" within the created @UUID to look like @UUID[longidname#page=12]{label]
  4. Create a second link that goes to a different page
  5. Select one of the page links to see the PDF open.
  6. Go back to the previous page and select the other link.
  7. Observe that the PDF is opened at a page that is NOT the page number selected in the link.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Please complete as much of the following information as possible:

  • Browser : Chrome
  • Foundry Version : 10.291
  • System : any
  • Module version: 10.6
  • Are there any errors in the console : No
  • Have you tried using Find the Culprit to make sure it isn't a module interaction.

Additional context
Add any other context about the problem here.

@ironmonk88
Copy link
Owner

Should be fixed in the latest version.

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

No branches or pull requests

2 participants