-
Notifications
You must be signed in to change notification settings - Fork 20
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
Require valid reference order for submission/publication #2300
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checkbox and radio elements should (almost always) be displayed inline with the text according to the browser default style, and should not be subject to a general rule that all input elements are block elements. (On the other hand, the invisible checkbox used in navbar.html should be invisible, so its selector needs to be made more specific.)
Past bugs in the project editing forms have allowed project references to be created with 'order=None', or with two references having the same 'order'. If this is the case, it should not be possible to submit or publish the project until the author or editor addresses the issue.
If a project has an invalid order of references, we must provide a way for the author or editor to review and fix the order. The past behavior of the "project content" and "copyedit" pages was that ReferenceFormSet would set the 'order' field for every form in the formset. The effect of that, however, was that 'order' would be set for: (a) newly added references (b) existing references whose 'description' was changed References that already existed, and whose 'description' field was unchanged, would not have been saved (because their form.changed_data was False.) Since many existing projects may have scrambled lists of references and can't be fixed automatically, we want broken projects to be "flagged", and we want that flag to persist until someone is able to review the project and check that it's fixed. In particular, simply opening the "project content" page and submitting it, without making any changes, should not cause the flag to be cleared. Therefore: if the project has an invalid reference order, then display a warning message with a checkbox (at the bottom of the page, below the reference list and above the submit button.) By default, that checkbox isn't checked, and in that situation, ReferenceFormSet should not alter any existing reference 'order'. Newly-added references should have a correct 'order', but if existing references were "invalid", they should remain "invalid". If the checkbox is checked, then ReferenceFormSet should set all reference 'order' to match the current form order (which is what the old code was trying to do, and didn't work because it didn't set changed_data.)
Past bugs in the project editing forms have allowed project references to be created with 'order=None', or with two references having the same 'order'. Either situation should now prevent the project from being submitted; check that this is the case. ReferenceFormSet should allow these situations to be fixed manually: if the confirm_reference_order checkbox is checked, then the 'order' of all references should be updated; and if that box is not checked, the 'order' of existing references should be untouched. Check that this works as expected.
bemoody
force-pushed
the
bm/require-ref-order
branch
from
September 20, 2024 20:27
c503b74
to
896cceb
Compare
oops - should be fixed! |
Nice, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Many existing projects have an invalid order of entries in their References section, due to issue #2137. "Invalid" means:
(a) One or more references have
order=None
, typically because it was copied from a past published version.(b) Two references have the same
order
value, typically because a reference was deleted from the middle of the list and then a new one was added.(c)
order
is distinct but doesn't matchid
order, typically because two references were deleted from the middle of the list and then a new one was added.Whatever the reason for having an invalid order of references, it is not feasible to fix the order automatically, so we want to require the author/editor to review and fix it by hand before the project is published.
The demo project "MIMIC-III Clinical Database" currently has
order=None
for its three references. With these changes, you should see:If you open the preview page, there is an error message "Order of references may be incorrect".
If you open the Project Content page, there is a warning at the bottom of the page.
If you add or edit references, and click "Save Description" (without checking the checkbox), the references should be saved but the warning should still be present.
If you check the checkbox and then click "Save Description", the warning should go away.
Alternatively, if you delete all three of the original references and then refresh the page, the warning should go away.