BUGFIX: Simplify UpdateWorkspaceInfo - #4136
Conversation
Refactor `UpdateWorkspaceInfo` to accept the workspace via constructor instead of a setter, eliminating the possibility of using the class without a workspace set. Extract the user workspace name directly from context paths on publish and discard, avoiding an unnecessary node lookup that could fail when the node no longer exists in context. Add a guard to prevent accidentally passing a base workspace to `UpdateWorkspaceInfo`.
599055a to
9b59554
Compare
| * | ||
| * @param array<int,string> $contextPaths | ||
| */ | ||
| protected function extractUserWorkspaceNameFromContextPaths(array $contextPaths): string |
There was a problem hiding this comment.
because its a bugfix its oke i think^^ this will find no application in Neos 9 because we dont have user- anymore and also i hope that we dont need it? Can you please also take care of upmerging this? The workspace in constructor makes also sense for 9.0
There was a problem hiding this comment.
I will see on upmerge how this is handled in 9, but hopefully better already :D
|
FYI: This is a breaking change (for 8.3+) with adding a mandatory parameter to |
|
The whole PHP codebase of the Neos Ui is internal. It was unfortunately never declared before Neos 9.0 and #3704 What was your usecase? |
|
Notify the UI about changes made during translation of nodes. |
|
Same issue was here: sitegeist/Sitegeist.LostInTranslation#104 |
|
Right, I think that is unfortunate. That said, our rule originally was if it's not marked api, it is not meant for public consumption and could change, with narrow exceptions due to long time "habits/customs". I think as soon as someone starts using stuff externally, it makes sense to request changes in core to make it API or suggest a sensible API. This code was always brittle. SORRY for breaking <3 |
Refactor
UpdateWorkspaceInfoto accept the workspace via constructor instead of a setter, eliminating the possibility of using the class without a workspace set.Extract the user workspace name directly from context paths on publish and discard, avoiding an unnecessary node lookup that could fail when the node no longer exists in context.
Add a guard to prevent accidentally passing a base workspace to
UpdateWorkspaceInfo.