Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
workspaces.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 May 2018 at 14:27 UTC
Updated:
15 Feb 2019 at 09:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
timmillwoodOne other incompatibility is "workspace" and "workspace association" entity types appear in a Content Moderation workflow settings as entity types which can have a workflow assigned to them.
Comment #3
timmillwoodSpecific example:
Comment #4
amateescu commentedI'm afraid we won't be able to solve this properly without #2942907: Entity system does not provide an API for retrieving an entity variant that is safe for editing.
Comment #5
amateescu commentedI opened #2971779: Disallow moderation of internal entity types for disallowing moderation on the
workspace associationentity type, and I think that allowing workspaces themselves to be moderatable is actually a nice feature :)Comment #6
fabianx commentedDifferent question: Why would you need content moderation features if you have workspaces?
What you want is an per entity workflow state (and one for the whole workspace as well) - yes:
https://www.drupal.org/project/entity_workflow
but you want workspaces to manage the actual revisions for that.
And even for content moderation of just one entity, you want to still have a micro workspace, because you have:
- paragraphs
- (panelizer) layout
- translations of all that
be all in one per-entity-workspace as else that really does not make sense.
e.g. Complex workflows we have work like that:
- When all entities are in state 'review', then allow to transition the workspace to the 'review' state
- Allow translators to import translations, then check that the translation looks good in context of the site and put the state of the translated reviewed entities to ''
etc.
So my proposal to solve that would be:
- Base content_moderation on per-entity micro-workspaces WHILE not being in a workspace itself (but hide all the complexity)
- Have content_moderation only do the workflows in the future
Alternatively:
- Have workspaces conflict with content_moderation and add a new workflows module as replacement for the workflow functionality of content_moderation
- Deprecate content_moderation once workspaces is stable
Comment #7
timmillwoodOne idea has always been, that content authors can add content to their workspace, then mark the workspace as "Needs review", the reviewer can then mark the workspace as "Approved". This could automatically replicate content upstream, or just inform the content author that they have approval to replicate the content.
That's an interesting through. However, the only reason the Workflow initiative was tasked with adding Content Moderation in core rather than just starting with Workspace was because Content Moderation was seen as the 80% use case.
Comment #8
amateescu commentedAs discussed in the "roadmap to Workspace beta" call, the initial step here is to disallow the Workspace module from being installed alongside Content Moderation.
Opened a followup to provide a minimal implementation which would allow them to work together: #2982937: Allow workspace integration to be enable per entity type and bundle
Comment #9
amateescu commentedComment #10
sam152 commentedWhat happens if you install workspace first? I think these checks are only invoked for the module you are installing and not all the modules already installed.
Comment #11
amateescu commentedThat's hilarious :D And it goes to show that
hook_requirements()is not good fit for declaring module incompatibilities. I think we have three options:1) mirror this
hook_requirements()implementation incontent_moderation2) add a way for modules to declare the incompatibility with another module in its
info.ymlfile, something like:3) introduce a
ModuleInstallValidatorInterface, similar to the existingModuleUninstallValidatorInterfaceLet's do 1) for now since it's the simplest option.
Comment #12
amateescu commentedOops.
Comment #15
timmillwood[cross post]
Comment #16
timmillwoodComment #17
amateescu commentedAdded #2982954: Allow modules to declare conflicts with other modules in their info.yml file as a followup.
Comment #18
timmillwoodLooks good now, thanks!
Comment #19
plachNot sure about changing stable code (and introducing new strings) to support experimental code. I can't think of another simple solution right now, but I'd be happier if we could find one.
Comment #20
amateescu commentedA simpler solution would be #2982954: Allow modules to declare conflicts with other modules in their info.yml file, but I'm not sure that can be done before 8.6.0-alpha1.
Another solution is to implement the "workspace integration by entity type and bundle" approach, but it would require similar changes to stable code (Content Moderation), because it also has to be workspace-aware and not allow people to enable CM support on an entity type already configured with workspace support.
However, the proper long-term solution (8.7) is to allow all the modules that work with pending revisions to interact seamlessly, through the revision tree proposal/idea.
Comment #21
timmillwoodI agree with @amateescu that this is currently the best course of action. Maybe it's worth explaining the reasoning within both install files, with a
@todoto remove once #2982954: Allow modules to declare conflicts with other modules in their info.yml file is in.Comment #23
timmillwoodComment #24
webchickAgreed with @plach that it's better that stable modules don't have references to / code affected by experimental modules. Especially since if Workspaces doesn't make it to beta for 8.6 and ends up getting postponed to 8.7 (which, I hasten to add, we all hope won't happen!!), we'd then be left with dead code in core, which is definitely not ideal.
He and I kicked this around a bit. It seems like we need to account for the following situations:
1. I already have Content Moderation installed, now I want to play around with Workspaces.
2. I already have Workspaces installed, now I want to play around with Content Moderation.
3. I enable both Content Moderation and Workspaces at the same time.
I believe all three cases are solved by the current hook_install() approach, since case 3 will end up changing to case 1, since Content Moderation is alphabetically first and therefore will get enabled first. And agreed that introducing new functionality or dependencies on stale core issues isn't a good idea. There's a hook_modules_installed() but the best this could do is fire a warning that's easily missed/skipped over.
However, while Workspaces integration isn't per-entity type+bundle, I'm curious if we could leverage the fact that Content Moderation's integration is done that way, and have Workspaces hook_form_alter() the config form that allows you to enable Content Moderation on any content/block types, to replace the form there with a message about you not being able to run both modules at once. That seems like it solves case 1 and 3 with not-too-much-code, which could all live in the experimental module where the compatibility problem's being introduced.
What do you think?
Comment #25
timmillwood@webchick - I think that could work and a good alternative to adding workspace related code in Content Moderation.
Just to clarify my understanding:
Comment #26
catchThis doesn't really seem viable to me. The whole model of workspaces is that you can make changes within a workspace and publish the whole thing at once. If entity types/bundles become admin configurable, then unless we prevent editing the non-workspace-enabled entities within workspaces, the behaviour will be very confusing. We already have the issue of path aliases and etc. which can't be workspace enabled.
I kind of feel like hook_requirements() (including in content_moderation) is the cleanest option here. We're not adding a feature or dependency, just avoiding an incompatibility, and it could have a @todo pointing to #2982954: Allow modules to declare conflicts with other modules in their info.yml file.
Comment #27
timmillwoodImplemented as a form_alter, removing all code from content_moderation, here's how it looks:
Comment #28
amateescu commentedThe approach suggested by @webchick in #24 and implemented in #27 seemed "viable" to do, but I have to agree with @catch that we are breaking the whole premise of workspaces if we disallow entity types from being a part of a workspace when they could have been.
Comment #29
amateescu commentedBtw, #2982954: Allow modules to declare conflicts with other modules in their info.yml file is not really stale, it was just opened yesterday with an initial patch :) Someone with actual knowledge of the module (installer) system could easily make it work, IMO
Comment #30
webchickOh, I'm sorry, I'm confusing that with some much older issue.
I'm also fine with @catch's proposal, btw. :) I think @plach was just looking for a second opinion. That said, #27 looks good to me from a screenshot POV!
Comment #31
timmillwood"workspace integration by entity type and bundle" is not implemented in the patch from #27, this is still set for the follow up #2982937: Allow workspace integration to be enable per entity type and bundle, but I agree with #26 and #28 that it would be the wrong direction.
The patch in #27 supports the two different outcomes described in #25.
I believe #27 is the best way forward. It throws the hook_requirements install error if Content Moderation is installed first and Workspace is tried to be installed afterwards. If Workspace is installed first, and Content Moderation after, the warning on the workflow entity form shown in the screenshot of #27 will be displayed.
Comment #32
plach@catch:
I'm +1 on #27: it allows to handle all the three use cases we identified without forcing us to touch stable code to support Workspace. The fact that Content Moderation can be enabled per bundle provides us a UI to alter, so that we can state that Workspace is incompatible with it, but this does not imply that we must do #2982937: Allow workspace integration to be enable per entity type and bundle: I also believe that Workspace should act on every aspect of the site, if we are ever able to support that.
Since basically this change makes CM unusable when WS is enabled, we could also choose to grey out the UI entirely or perform something more radical, but I wouldn't spend too much time on this. Hopefully enabling WS and then CM is not the 80% use case.
Of course we need a green patch :)
Comment #33
catchI'd prefer to go with #12 with the hook_requirements() compared to #27 - it's closer to the behaviour once .info.yml files support incompatibility, and it's already green. I think we can just exclude hook_requirements() from the 'no code about experimental modules' rule since it's not even runtime.
Comment #34
catchRe-uploading an RTBC-ing. If someone has strong objections please say so but for me it's clean and it works.
Comment #35
timmillwood@catch - personally I'm fine with that. I do think #27 is a nice solution to the problem, but is also gives an inconsistent result depending on the order modules are installed. The test fixes look pretty simple though if we do want to go on that route.
In the unfortunate circumstance that Workspace doesn't make it to Beta, then we'll just need to remember to revert this commit, or remove the code from content_moderation.install.
Comment #36
webchickOk, sounds like we have an agreed-upon path forward! :)
Committed and pushed to 8.6.x. Thanks!
Comment #38
chris matthews commentedExtremely minor nitpick, but I thought it was at least worth mentioning.
Should can not be changed to cannot? http://grammarist.com/usage/cannot-or-can-not
Comment #39
plachYou're welcome to open a (novice?) follow-up ticket to discuss/implement your suggestion :)
If you do please post the link here.
Comment #40
jibranDER and Workspace both override EFQ. Right now DER v2 EFQ integration will break if the workspace module will be enabled. Related DER issue is #2835542-11: Utilize service decorator instead of taking over entire EFQ service.
Comment #41
amateescu commentedFix component following module rename.
Comment #43
mpp commentedI'm puzzled. Drupal 8.6 released with
Workspaceas an experimental module but it's not compatible withContent Moderationwhich is now stable in core, how can this be?Comment #44
timmillwood@mpp The two modules are simply incompatible with each other. As Drupal core adds features and modules it was bound to happen that two things are incompatible with each other.
The incompatibility comes down to the fact that they both allow pending revisions to be created and track them in different ways. Allowing both to create pending revisions at the the same time leads to internal confusion. Ideally down the road we need to find a generic way to track the revisions and allow modules to live in harmony, but I believe we have bigger things to work on than allowing these modules to live side by side.
Comment #45
webdrips commented@timmillwood I hope you see this since the issue is closed, but I for one would love to see both modules be allowed to work together.
Comment #46
amateescu commented@webdrips, there's a very good chance for them to work together in 8.7. Follow #3023194: [PP-2] Add parallel revisioning support and #2725523: Add a revision_parent field to revisionable entities for that effort.
Comment #47
webdrips commented@amateescu thank you!