- πΊπΈUnited States smustgrave
Will this still need tests?
Could new functions be typehinted?
Didn't do a full code review (not as familar with workspaces)
- Assigned to amateescu
- π·π΄Romania amateescu
Rolled this patch on top of π [PP-1] Prevent content from being deleted when there is an active workspace Postponed , for those who need it.
This definitely still needs some test coverage, I'll look into that next.
- π·π΄Romania amateescu
Same patch as above, for who needs it to apply against Drupal 9.5.x.
- πΊπΈUnited States raystuart Indianapolis
To apply the 9.5.x patch in #3101671-21: Add mechanism to have workspaces skip processing entity types β I also needed to apply these patches before:
* #3129762-20: Creating an unpublished entity in a workspace does not set the workspace field on the revision β
* #3092247-57: [PP-1] Prevent content from being deleted when there is an active workspace β - π§πͺBelgium cedricl
For drupal core 9.5.x i'm getting
Cannot apply patch https://www.drupal.org/project/drupal/issues/3101671#comment-14976504 (https://www.drupal.org/files/issues/2023-03-21/3101671-21-against-deletable-9.5.x.patch)!
Any fixes for this issue. I also applied the patches from #22 - First commit to issue fork.
- π·π΄Romania amateescu
@CedricL, see comment #22, you also have to apply two other patches before this one.
- last update
over 1 year ago 29,699 pass, 17 fail - @rpayanm opened merge request.
- π·π΄Romania amateescu
Updated to the latest coding standards. Leaving at NW for adding test coverage.
- last update
over 1 year ago 29,845 pass, 16 fail - last update
over 1 year ago 29,959 pass - πΊπΈUnited States webdrips
Reroll #30 for 10.2.2, but would expect it to work on 11.x based on the minor change.
- πΊπΈUnited States webdrips
Trying this again as the last patch missed a
- πΊπΈUnited States webdrips
Trying this again as the last patch missed a directory.
- πΊπΈUnited States webdrips
Even with the updated patch plus #3092247-62: "[PP-1] Prevent content from being deleted when there is an active workspace", I'm not able to upload images in the non-default workspace.
I get the following error via Ajax:
Drupal\Core\Entity\EntityStorageException: This entity can only be saved in the default workspace. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php). workspaces_entity_presave(Object) call_user_func_array(Object, Array) (Line: 409) Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'workspaces') (Line: 388) Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_presave', Object) (Line: 416) Drupal\Core\Extension\ModuleHandler->invokeAll('entity_presave', Array) (Line: 217) Drupal\Core\Entity\EntityStorageBase->invokeHook('presave', Object) (Line: 900) Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('presave', Object) (Line: 529) Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 753) Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object) (Line: 483) Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 806) Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 352) Drupal\Core\Entity\EntityBase->save() (Line: 293) Drupal\file\Upload\FileUploadHandler->handleFileUpload(Object, Array, 'public://hero_images/', 0) (Line: 658) file_save_upload('field_content_hero_0_subform_field_hero_image_0', Array, 'public://hero_images', NULL, 0) (Line: 536) _file_save_upload_from_form(Array, Object) (Line: 1007) file_managed_file_save_upload(Array, Object) (Line: 76) Drupal\file\Element\ManagedFile::valueCallback(Array, Array, Object) (Line: 337) Drupal\file\Plugin\Field\FieldWidget\FileWidget::value(Array, Array, Object) call_user_func_array(Array, Array) (Line: 1266) ...
- Issue was unassigned.
- Status changed to Needs review
10 months ago 1:22pm 20 February 2024 - π·π΄Romania amateescu
@webdrips this patch only adds the possibility to "ignore" entity types in a workspace, it doesn't yet do it for the File entity type. That will probably happen in π Cannot create entity with image in a workspace Fixed .
Here's a fairly extensive update after using this patch in production for several years. The problem with the initial approach (using constants on
WorkspaceInformationInterface
) was that an entity type could not declare its workspace support when the Workspaces module wasn't installed, since the interface couldn't be loaded, so we're now using explicit entity handlers for supported and ignored entity types. Entity handlers can point to a non-existent class, because the class won't be invoked until someone tries to instantiate that handler.Also added test coverage, so removing the tag. I'll convert the patch to a MR, then it should be fully ready for reviews!
- π·π΄Romania amateescu
amateescu β changed the visibility of the branch 11.x to hidden.
- π·π΄Romania amateescu
amateescu β changed the visibility of the branch 3101671-11.x to hidden.
- π·π΄Romania amateescu
Updated the issue summary and hid all the patches because we have an MR now.
- Status changed to Needs work
10 months ago 11:50pm 29 February 2024 - πΊπΈUnited States smustgrave
Made a few suggestions but they can apply to a number of the files.
But is there BC concerns for marking previously not internal files as internal? I don't know the policy around that.
- Status changed to Needs review
10 months ago 3:42pm 1 March 2024 - π·π΄Romania amateescu
@smustgrave, thanks for reviewing! Fixed your suggestions, and after scanning the code again for similar changes that could be done to other constructors, I think I would prefer to "modernize" them all in a separate issue.. this MR is already big enough IMO.
Updated the CR as well.
FWIW, this is the #1 issue in the (somewhat short) list of blockers for marking Workspaces as stable, which I hope we can do in 10.3 :)
- Status changed to RTBC
10 months ago 5:10pm 1 March 2024 - πΊπΈUnited States smustgrave
Changes look good and test updates. CR reads well
- π¬π§United Kingdom catch
Adding a handler is a good idea, and the entity type/entity split handles block content entities nicely - flexibility but without a lot of messing about for entity types that don't need it.
Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!
- Status changed to Fixed
10 months ago 10:50am 4 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.