-
Notifications
You must be signed in to change notification settings - Fork 171
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
Adjust edit workflow to be compatible with a default moderation state of draft. #4002
Conversation
aefbe93
to
7f6bc8e
Compare
47ca04e
to
5149d67
Compare
Unfortunately when testing this with PDC, PDC's custom publication approach is creating draft distributions on publish. ARGH. Possibly related to the fact that PDC is using the local url resource download url display, so this may be a unique problem when the last published version of a dataset had a different local url (e.g. an Acquia server). |
I think we can mark the too-many-methods codeclimate error in NodeWrapper\Data as won't fix. Let's strategize about this and related workflow issues. |
e071842
to
bfedeb9
Compare
b54f9c8
to
3a4d6d2
Compare
3a4d6d2
to
0a54f57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I'm not sure why the resource directories don't get removed but that is out of scope of the ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I think there's just a lot going on in the metastore that shouldn't be necessary, but for now this appears to fix the pressing issues and improve test coverage. The cost is more complexity but I think its a good trade off to fix the draft workflow and we can think about a higher-level refactor later down the line.
…g changed. (tests still broken)
…apper_new_revision
76e0080
to
ab704a3
Compare
Ran through a basic test run with OP and this branch seems OK. |
Question about this change: It seems to me since this change you can not edit the download URL of a distribution directly, but only via the dataset. Am I right about that? Is that intended? |
@stefan-korn correct, all user interaction is handled via the dataset form (or metastore API). The separate distribution node is a referenced artifact for use in the internal workings. Changing the downloadURL will generate a NEW distribution. |
DatastoreSubscriber::onPreReference compares the old version of the metadata to the new version of the metadata during dataset preSave and then queues a datastore_import and orphan_reference_processor queue items if there is a change.
However, it's using the node->original property which is incorrectly set to the last PUBLISHED revision of the node, not the LATEST revision. When using a publication workflow with draft datasets that are later published, this results in the datastore_import being queued incorrectly when the dataset draft is published.
In addition, this PR removes a bunch of logic related to triggering datastore imports and orphan reference processing from the presave hook on data dictionaries.
Lastly, this PR checks for orphans from the last published revision when publishing a new revision of a dataset if the latest revision was not published. (e.g. if this was a draft revision being published)
This adds 5 new functional tests to cover the workflows that were not previously covered.
QA Steps