Restore documented answer set import behavior which was broken accidentally#1025
Restore documented answer set import behavior which was broken accidentally#1025nonprofittechy merged 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restores the "Import answer set" menu item that was accidentally removed in a prior commit. The menu entry now correctly points to the JSON upload flow (defined in al_saved_sessions.yml) instead of the emergency document-download screen it was previously miswired to. The label was also corrected from "Download answer set" to "Import answer set", and an admin bypass was added so that logged-in admins can always access the import feature.
Changes:
- Replaced the URL from
url_action('al_error_action_download_screen')tourl_ask(["al_sessions_json_file", ...])to correctly wire the menu item to the JSON import flow. - Updated the
hiddencondition to require bothenable answer setsandenable answer set importsconfig flags, with an admin bypass for logged-in admins. - Changed the
al_download_answer_set_stringtemplate content from "Download answer set" to "Import answer set" to accurately reflect the action.
|
@nonprofittechy I've opened a new pull request, #1026, to work on those changes. Once the pull request is ready, I'll request review from you. |
…or consistency Co-authored-by: nonprofittechy <7645641+nonprofittechy@users.noreply.github.com>
Rename `al_download_answer_set_string` to `al_import_answer_set_string`
BryceStevenWilley
left a comment
There was a problem hiding this comment.
Looks fine to me. I'll be sure to do a much deeper review on the security beef-up you're planning ;)
09edd7d accidentally removed the menu item to allow answer set importing. This function needs more review, but it can be useful now on a development-only server when used by admins.
The commit looks a little funky because the old code had a few errors.
download screen at al_visual.yml#L101, and that screen still renders the in-progress document downloads at
al_visual.yml#L583.
Import answer set. The new menu entry now points to the JSON upload flow at al_visual.yml#L113, and the label
text was updated at al_visual.yml#L144. That upload screen is the JSON import screen at
al_saved_sessions.yml#L232.
emergency document download screen, not an answer-set export flow. So the latest change did not overwrite a
working download screen; it fixed a long-standing miswire.
the share flow at al_visual.yml#L292 and from the saved-answer-set detail screen at
al_saved_sessions_store.yml#L41.
I consider this an experimental feature that should only be used by developers, and that's how we describe it everywhere in our documentation right now. The installer also does not turn this feature on by default. Server admins need to opt-in to it.
Therefore, restoring this should be low risk.
I'm working on a larger security plan to beef this feature's safety up.