Account created on 21 February 2010, about 14 years ago
#

Merge Requests

More

Recent comments

🇷🇴Romania amateescu

It seems this small change won't make it into this module, the core issue in Workspaces is getting fixed though, so closing this one.

🇷🇴Romania amateescu

This is actually a bug because in HEAD, if you have Layout Builder enabled and edit an entity in a workspace, when you visit `/node/X/layout` in Live, the concurrent editing message is not displayed. Added a test for this problem and keeping the issue at RTBC because it's a simple test addition with no other functional change to the MR.

🇷🇴Romania amateescu

Added a basic token validation for the query parameter workspace negotiator to comply with the interface description of the new method.

🇷🇴Romania amateescu

Ok, let's do this, the change is harmless and allows the class to be instantiated :)

🇷🇴Romania amateescu

In the service definition, the workspaces.association service must be marked as optional because it might not exist (for example when the Workspaces module is not enabled).

Note that this is not a bug because \Drupal\content_moderation\EventSubscriber\WorkspaceSubscriber is an event subscriber class, and it shouldn't be instantiated unless it needs to react to the WorkspacePrePublishEvent event, which is only invoked when the Workspaces module is enabled. If some other module instantiates it.. well, it shouldn't :)

If we want to make a change in core though, we need to mark the argument as optional in \Drupal\content_moderation\EventSubscriber\WorkspaceSubscriber::__construct(). Updated the issue summary to reflect that.

🇷🇴Romania amateescu

Discussed a bit with @catch and I'll do a few changes to the MR.

🇷🇴Romania amateescu

Well.. the MR doesn't change any functionality in Views, so I don't think it's needed here :)

🇷🇴Romania amateescu

As for test coverage.. I don't think it's needed because this doesn't really change the behavior of workspace negotiators.

🇷🇴Romania amateescu

Btw, a quick`n`dirty way to test this MR is to edit a couple of entities in a workspace and manually change WorkspaceViewBuilder.php::$limit to 1 :)

🇷🇴Romania amateescu

Started a MR with a new approach that builds upon the entity form controller override that was added in 🐛 [PP-1] Prevent content from being deleted when there is an active workspace Postponed . That service is new in 10.3.x, so it doesn't need any deprecation handling :)

🇷🇴Romania amateescu

Implemented the separate method as discussed above, and it's looks much better!

Regarding \Drupal\Core\Database\Query\TableSortExtender, we can't use it because the data displayed in the table is coming from the individual revision objects, not from the `workspace_association` table.

🇷🇴Romania amateescu

That works if you have one image gallery with multiple images. What happens if you want two image galleries?

At the storage level, the first gallery can use deltas 0 to 3 (contains 4 items), and the second gallery can use deltas 4 to 6 (contains 3 items). Then at the `TypedData::get()` level we can assign each delta item to its specific component (gallery).

🇷🇴Romania amateescu

It turns out that the work done in 📌 Add an API for allowing modules to mark their forms as workspace-safe Needs work was pretty much on point and useful for the use cases tackled by this issue.

Some changes in this MR might seem weird, so I'll add some comments on the MR itself to try and explain them directly in a code context.

🇷🇴Romania amateescu

We can do something like this in WSE, but we also need an issue in the Diff module to factor out getting the revision IDs from \Drupal\diff\Form\RevisionOverviewForm::buildForm() into a separate method, because overriding and copying all that code is a bit too much to do in this module.

Once we have that issue (and patch), we need to extend this patch and override \Drupal\diff\Form\RevisionOverviewForm.

🇷🇴Romania amateescu

@capita that's not possible currently because there's no integration between JSON:API and Workspaces. That's what we're trying to figure out in this issue :)

🇷🇴Romania amateescu

Adding the url.path cache context to every page would be a performance regression, and we can avoid it if we use a lazy builder instead for the workspace toolbar tab, just like announcements_feed module does it.

I wasted a lot of time trying to add test coverage, with no success: https://git.drupalcode.org/project/drupal/-/merge_requests/7605/commits . Adding coverage for this should be as easy as adding a few more drupalGet() calls in WorkspaceToolbarIntegrationTest::testWorkspaceSwitch(), but our functional javascript test framework disagrees :/

My proposal is to go with only manual testing here, otherwise the issue will be stalled for who knows how many years...

🇷🇴Romania amateescu

amateescu made their first commit to this issue’s fork.

🇷🇴Romania amateescu

📌 Add an API for allowing modules to mark their forms as workspace-safe Needs work will make it possible for contrib/custom modules to declare their forms as workspace-safe.

🇷🇴Romania amateescu

Opened a MR for it, and the bug can be easily tested by changing the existing coverage to do menu link operations via the UI, as it should :)

Btw, the problem is not only for sub workspaces, top-level ones have the same issue.

🇷🇴Romania amateescu

I was 100% sure we had test coverage for this, so I looked into it and turns out it's a problem that can only be reproduced in the UI, and even though WorkspaceMenuLinkContentIntegrationTest is a functional test, it's doing CRUD operations on menu links via API calls :/

🇷🇴Romania amateescu

Changed the approach to use two interfaces instead of a trait, and updated the issue summary and the change record.

🇷🇴Romania amateescu

Moved the guide under "Core module" since it was marked stable in https://www.drupal.org/project/drupal/issues/3088643 📌 Mark Workspaces as a stable core module Fixed

🇷🇴Romania amateescu

I can't reproduce this with latest Drupal 10.2.x and wse, did you have any other wse submodules installed by any chance? I tried with wse_config, wse_lb, wse_menu all installed, and drush pmu wse still worked.

🇷🇴Romania amateescu

@alexpott the idea with a trait came up specifically for the dynamic nature that some modules might need, like Layout Builder in core :)

The difference is that in HEAD, LB has to call a method in each form class for marking its forms as workspace-safe, while with the trait approach it only has to ensure that its method name matches the one from the "top-level" trait, and Workspaces takes care of calling it in its own form alter.

I don't mind going for the interface approach you suggested, Workspaces itself does that currently and it works great when there's no dynamism involved. Should we wait or ask for other opinions or do you feel (strongly or not) that the interface will be far simpler to implement for the majority use cases?

🇷🇴Romania amateescu

Workspaces was just marked stable 📌 Mark Workspaces as a stable core module Fixed , so.. 8 years later it's finally time to close this issue! :D

🇷🇴Romania amateescu

Even after 10.3, this module will still provide useful features that are not (yet) in core:

- move a piece of content from a workspace to another
- discard changes
- revert a workspace publication
- change menu hierarchies in a workspace with the `wse_menu` submodule

So I think the answer is "yes" :)

I'll probably need to open a 2.x branch that will only be compatible with 10.3+ because there are way too many changes to take into account for previous core versions.

🇷🇴Romania amateescu

We also need to update that info for our test module, and it's probably time to drop support for 8.7.7 :)

🇷🇴Romania amateescu

Since @catch was not a fan of the event approach, here's an alternative that would allow modules to declare their forms as workspace-safe even when the workspaces module is not installed.

I added the trait in the Drupal\Core\Form as an initial proposal, but it could also be added somewhere in the system module I guess..

Once Workspaces will be marked as stable, more and more modules will have to integrate with it, so I'm raising the priority of this issue.

🇷🇴Romania amateescu

amateescu changed the visibility of the branch 3208390-add-an-api to hidden.

🇷🇴Romania amateescu

Posted a few comments on the 11.x MR. Otherwise this looks good to me :)

🇷🇴Romania amateescu

Oops, I didn't realize we don't need that service anymore. Since the Merger class is not a service and it's also tagged @internal, I only removed the argument from its constructor, but I had to do the whole deprecation dance anyway for WorkspaceOperationFactory because that's an actual service :/

Also added a CR for it: https://www.drupal.org/node/3440755

🇷🇴Romania amateescu

Turns out I was wrong in #2, the problem here is WorkspaceAssociation::onPostPublish() not deleting the associations of sub-workpaces.

🇷🇴Romania amateescu

Hm.. that's right, I thought 🐛 Sub workspace does not clear Closed: duplicate was about the value of the workspace metadata field, but it's actually about WorkspaceAssociation::onPostPublish() not deleting the associations of sub-workspaces. I'll reopen it :)

🇷🇴Romania amateescu

Just a quick note: we're removing the hidden dependency of workspaces on path_alias in 📌 Fix Workspaces' hidden dependency on the path_alias module Needs review .

🇷🇴Romania amateescu

This will also help with 📌 Make "path_alias" module optional Needs work where the (current) MR took a shortcut and made the dependency explicit.

🇷🇴Romania amateescu

Added test coverage and revamped the issue summary since this can no longer be reproduced via the workspace conflict constraint.

🇷🇴Romania amateescu

I also don't have access to that prototype, but, until it can be sorted out, there are a few screenshots in 📌 UX: Elevate the Workspace UI around the site canvas Needs work and a gif animation in #2732081-8: WI: Phase G2: Full-site preview with Workspace UI , which demonstrate a large portion of the design concept for Workspaces UI.

There's also a recording of a UX meeting where that design was discussed: https://www.youtube.com/watch?v=hf8AovBZflo

🇷🇴Romania amateescu

Improved the patch a bit and converted to a MR, still needs tests so leaving at NW for now.

🇷🇴Romania amateescu

We also need to skip generating path aliases when a workspace is published, here's an update for that.

🇷🇴Romania amateescu

@catapipper, since 🐛 Regression: Do not bypass route access with 'link to any page' permissions for menu links Needs work was committed to Drupal 10.3, can you please test with that patch applied instead of the one from this issue and check if it fixes your problem?

🇷🇴Romania amateescu

WSE will need a big update to make it compatible with core 10.3, because all the of core patches that are included in the module have been committed. A lot of code will need to be removed in a commit that will make the module require 10.3.

🇷🇴Romania amateescu

Update the wording to match the current UI of the module.

🇷🇴Romania amateescu

Replied in the MR why I don't think an upgrade path is needed.

🇷🇴Romania amateescu

@andypost, yes, all the things mentioned in the issue summary are still left to do.

🇷🇴Romania amateescu

That SQLite test failure was great, it revealed that WorkspaceAssociation::getEntityTrackingWorkspaceIds() was relying on implicit sorting on mysql and postgres. Committed a fix for that.

🇷🇴Romania amateescu

Pathauto generation works fine with the small patch from #3283769-8: Allow path generation inside of a workspace , so I'm closing this one as a duplicate.

🇷🇴Romania amateescu

I think we should take a much simpler approach and just check if the Workspaces module is enabled, and allow alias generation if a workspace is active.

🇷🇴Romania amateescu

I'm pretty sure that if there was an actual problem you bumped into, it was probably 🐛 Views queries are not properly altered Fixed . Closing for now but please re-open if that's not the case.

🇷🇴Romania amateescu

Even though there are no steps to reproduce in core because the user's password field is not translatable, I think the patches and all the discussion in the issue highlight the deficiencies of PasswordItem, so I think the issue is still valid, just needs someone to pick it up :)

🇷🇴Romania amateescu

Duplicate of #3035089: Menu link hierarchy should be revision-aware .

Note that the `wse_menu` submodule of the Workspaces Extra module provides a temporary solution for this, by storing the entire menu tree per-workspace in a custom entity type.

🇷🇴Romania amateescu

Just wanted to point out that this issue really is outdated, all the code around adding fields from the UI was shuffled a lot in Make field selection less overwhelming by introducing groups Fixed and the followup issues.

🇷🇴Romania amateescu

📌 Simplify the workspace conflict validator Needs work ended up with the 'WI critical' tag because it adds the test coverage requested in #3091481: Add explicit test coverage for EntityWorkspaceConflictConstraintValidator , so moving it up to the must-have list.

Also adding #2968165: Finish the Views integration to the should-have list.

🇷🇴Romania amateescu

Now that the parent roadmap issue has only one "must-have" issue left, I think it's time to open the review process from core maintainers for this one :)

🇷🇴Romania amateescu

@alexpott because WorkspaceAssociation::getTrackedEntities() is a "low level" API function that shouldn't be influenced by any global pager. Maybe this is another point in favor of adding a separate method for this listing :)

🇷🇴Romania amateescu

@smustgrave, you don't need 50 workspaces, just to edit >50 entities in a workspace :P

One thing I don't really like about this MR is the large number of arguments of WorkspaceAssociation::getTrackedEntities(), but I didn't have any better idea. Maybe a new method is needed for getting a "paginated" list of tracked entities, without the ability to filter by entity type ID and entity ID... not sure.

🇷🇴Romania amateescu

Test coverage for this validator is being added in 📌 Simplify the workspace conflict validator Needs work . I've moved the 'WI critical' tag over there, so closing this one as a duplicate.

🇷🇴Romania amateescu

Converted the latest patch to a MR, changed the approach for marking LB forms as workspace-safe by using a trait and marking individual forms, so this issue doesn't depend on 📌 Add an API for allowing modules to mark their forms as workspace-safe Needs work anymore.

Tests were added in #22, I just moved them to the Workspaces module, so removing the tag.

🇷🇴Romania amateescu

I think this is a good DX improvement, let's do it :)

🇷🇴Romania amateescu

amateescu made their first commit to this issue’s fork.

Production build 0.67.2 2024