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

Rename for upcoming fava 1.20 #60

Closed
wants to merge 1 commit into from

Conversation

seltzered
Copy link

Fix #59

@redstreet
Copy link
Owner

Thanks. Would it be possible to make this backward compatible?

@aclindsa
Copy link
Contributor

Thanks. Would it be possible to make this backward compatible?

In case it helps, I introduced some version detection logic for a similar issue in 047acbb. Maybe that could be made more generic and re-used here?

@aclindsa
Copy link
Contributor

After trying this patch out, I do not believe it is the correct fix. If you look closely at the diff from beancount/fava@9e99001#diff-34e70ccbc25aaa9a79d126c4b4b93bc93948cb6dfe9bd5b5978d8a1ea4227205, you will find that the way github is presenting it is misleading. At first glance it may look like url_for_source is the new name for url_for_current, but in fact url_for_source has existed for some time, and url_for_current has recently been removed.

When I try out this change I am redirected to https://example.com/my-finances/editor/?module=aa_class instead of the expected https://example.com/my-finances/extension/Investor/?module=aa_class when clicking on the "Asset Allocation Classes" link on the main fava investor page. This results in me being dumped into the fava editor for my beancount file instead of the expected asset allocation chart/table.

And this behavior makes sense when you read the comment for the url_for_source function: "URL to source file (possibly link to external editor)."

@aclindsa
Copy link
Contributor

Maybe @yagebu can help us understand the best way for plugins to reference their own URL here, given the removal of url_for_current.

@yagebu
Copy link
Contributor

yagebu commented Jul 31, 2021

Something like url_for("extension_report", report_name="ExtensionName", module="....") should work (and also work with older Fava versions)

@aclindsa
Copy link
Contributor

aclindsa commented Aug 1, 2021

I just made a MR based on the suggestion from @yagebu as #62. I have tested that it works with the latest fava.

@seltzered seltzered closed this Aug 1, 2021
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

Successfully merging this pull request may close these issues.

Exception on Load: jinja2.exceptions.UndefinedError: 'url_for_current' is undefined
4 participants