Problem/motivation
Upon completion of replication, entities have differences in url alias from source url aliases.
Current behaviour
If url aliases patterns depend on several entities, during replication they can be created earlier than the replication of dependent entities is completed, which leads to differences in the summary alias of the source and target workspace entities.
Expected behaviour
Source and targets entities must have the same url aliases.
Remaining tasks
- Add
test_dependenciesin a separate patch #3019632: Add `pathauto` to `test_dependencies`. - Handle Event dispatching in #2971926: Better dispatch events. Add all events already proposed there but store
$replicationobject inEvent. - In current issue we should only add
EventSubscriberand test.
| Comment | File | Size | Author |
|---|---|---|---|
| #47 | 3015058-47.patch | 12.68 KB | spheresh |
| #47 | interdiff-3015058-47.txt | 646 bytes | spheresh |
| #35 | interdiff-3015058-35.txt | 4.28 KB | axicdv |
| #35 | 3015058-35.patch | 12.68 KB | axicdv |
Comments
Comment #2
axicdv commentedComment #3
l0keUsage of
array_keysand accessing element in array by index is very sensitive to any change and can be broken easilySuggestion:
Don't use
\Drupal::in OOPSuggestion:
Comment #4
axicdv commentedComment #5
axicdv commentedComment #8
l0keComment #9
jeqq commentedThe failing tests points to the issue.
Comment #10
l0keI don't think there is an issue, it's just that coding standards does not support nullable types.
Comment #11
jeqq commented@l0ke I tend to not accept new PHP features until they will be fully supported by core and tests on d.o pass.
Comment #12
axicdv commentedComment #13
axicdv commentedComment #14
l0keComment #15
jeqq commentedThis needs tests.
Comment #16
axicdv commentedComment #19
axicdv commentedComment #21
axicdv commentedComment #23
l0kehttps://www.drupal.org/docs/8/creating-custom-modules/let-drupal-8-know-...
We need to add
test_dependenciesto run our test properly but as the quote above says it cannot be done in a single patch.I'd like to ask for your opinion what is the best scenario here?
And I also noticed that there is another issue with dispatching events #2971926: Better dispatch events we need to align with.
In my opinion it is better to store full
$replicationentity in event not just$sourceand$targetto give as much context as we can.Comment #24
jeqq commentedRegarding the test dependencies, I faced this before and the fix is simple, as the documentation says, we need to add the test dependence in a separate patch and commit that one first.
I agree that using the replication object in the event is better.
Comment #25
l0keI've updated the issue summary. Patches will follow-up soon.
Comment #26
l0keComment #27
axicdv commentedThis patch is not a continuation of patch 3015058-21 and is intended only for local testing.
Comment #28
axicdv commentedComment #30
axicdv commentedComment #33
jeqq commented@axicdv Relaxed and Workspaces are two modules that implement totally different concepts, Relaxed provides an extension for the core REST API and Workspace makes possible to group content together (on workspaces). While Relaxed depends on Workspace, the second one should work independently of the first one (as it is now). Making Relaxed a dependence for Workspaces is not correct, it shouldn't be there neither as a test dependence.
Comment #34
jeqq commentedAs I see from the patch, if you need to use the Relaxed events then your patch should go into Relaxed, not into Workspace. If you still need to fix aliases for internal replication too, then there should be implemented a fix in Workspaces without using Relaxed.
Comment #35
axicdv commentedComment #36
axicdv commentedComment #38
l0ke#2971926: Better dispatch events needs to be commited first.
Comment #39
l0keComment #40
l0keI think all points were sorted out, the current case is covered with a new test and all tests are passing.
Comment #41
l0keComment #43
jeqq commentedThank you!
Comment #44
jeqq commentedComment #47
spheresh commentedChanges required to issue #3016386: Allow to switch into an unpublished workspace
Comment #48
jeqq commented@spheresh Why do you upload a patch that has been already committed and the issue fixed? First it won't apply and second the issue has been fixed, open a new issue if needed.
Comment #49
spheresh commented@jeqq I just should apply this path to @beta18 version of the module. I know that life is much better when you are a maintainer, but I have to live in a world where you need to solve the composer.json requirements. Thank you for remarks, I'll create a new issue.
Comment #50
jeqq commented@spheresh The purpose of my remark is for respecting the best practices and your perception about us living in different worlds is wrong.
I respect your work and at the same time I have to be responsible for what people post here. In your case, the change you added to that patch is totally non relevant to this issue and it should live in another patch, in another d.o issue. Even if it would be relevant - in that case is created a follow-up issue if the current one is already fixed.