pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
307 stars 448 forks source link

Relax editing metadata on published/posted materials #10263

Open asmecher opened 4 months ago

asmecher commented 4 months ago

Describe the bug Currently, when content is published/posted in OJS/OMP/OPS, editors are restricted from making further changes: image

In practice, however, editors want the ability to tweak/edit metadata in published content. This has led to anti-patterns like unpublish/edit/republish cycles.

In OMP, there is an additional problem, where certain data on Publication Formats can't be accessed/reviewed because the edit links disappear once the content is published.

Accepting that editors are going to want to tweak metadata after publication, we should keep the warning message present, but stop restricting edits. We should trust the editors to understand the implications of making edits, but not try to prevent it.

ewhanson commented 4 months ago

We had previously relied on the act of publishing (e.g. Repo::publication()->publish()) to indicate that metadata (new or changed) is available for downstream service to consume and used this as a jumping off point. By making it possible to edit this metadata post publication, I propose that we should treat each save event of the metadata as a MetadataChanged event and make use of the MetadataChanged and BatchMetadataChanged events.

I would propose a naive approach that simply always dispatches the MetadataChanged event when the form is saved/updated post publication, and let each individual implementation be in charge of deciding what metadata is important to process.

This approach has the advantage of using already existing events and jobs and allows any updates to happen asynchronously to the web request. It is also extensible for any future services or third-party plugins that need to know when metadata has been updated.

Examples of downstream services that would make use of this (either currently implemented or future implementations):

Hafsa-Naeem commented 3 months ago

@asmecher Ready for review OJS_main: ojs: pkp/pkp-lib#10263 Relax editing metadata on published/posted materials #4410 pkp/pkp-lib: pkp/pkp-lib#10263 edit metadata post publication #10335 pkp/ui-library: pkp/pkp-lib#10263 Relax editing metadata on published/posted materials #398

asmecher commented 3 months ago

Thanks, @Hafsa-Naeem! @Vitaliy-1, would you be able to review this one?

jardakotesovec commented 3 months ago

@asmecher @Hafsa-Naeem On ui-library side of things this make sense to apply to the new side modal workflow page. Trying to get that side modal workflow page as default on main branch ASAP.. Its probably 2-4 weeks away.

ajnyga commented 2 months ago

This is a good change, because journals get stuck and create new versions easily without any good reason (correcting a typo etc.)

Just asking that when we now edit the metadata, is this visible in the editorial history? ie. do we stamp who did what? I think this is important especially after something has been published.

asmecher commented 2 months ago

There would be an event in the event log, but if the editor chooses not to create a new version, the change will not be tracked.

Note that we'll be extending versioning further with https://github.com/pkp/pkp-lib/issues/4860 -- description there.

jardakotesovec commented 6 days ago

@Hafsa-Naeem Hi Hafsa, I am still active on this codebase, but risk of code conflicts is lot lower as most things are getting settled.

Permission to edit publication is now calculated here - https://github.com/pkp/ui-library/blob/main/src/pages/workflow/composables/useWorkflowPermissions.js#L70 . So that might be only place you need to adjust on frontend.

Let me know if you have any difficulties.