Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: 9.0 migrate node.context.currentRenderingMode.edit #23

Closed
mhsdesign opened this issue Jul 7, 2023 · 6 comments · Fixed by #28
Closed

TASK: 9.0 migrate node.context.currentRenderingMode.edit #23

mhsdesign opened this issue Jul 7, 2023 · 6 comments · Fixed by #28

Comments

@mhsdesign
Copy link
Member

node.context is not available anymore.

https://github.com/neos/neos-development-collection/blob/f4ed8369957209ba689cb2e1d9319e39716d6ac3/Neos.Neos/Resources/Private/Fusion/Prototypes/ContentCollection.fusion#L30

@mhsdesign
Copy link
Member Author

see
#23

${Neos.Backend.isEditMode(request)}

@dlubitz
Copy link
Contributor

dlubitz commented Sep 29, 2023

We need to specify that more in detail. I already found recgtor migrations, but AFAIS they are already outdated right?

Fusion

return CodeSampleLoader::fromFile('Fusion: Rewrite node.context.live to Neos.Node.isLive(...)', __CLASS__);

return CodeSampleLoader::fromFile('Fusion: Rewrite node.context.inBackend to Neos.Node.inBackend(...)', __CLASS__);

'/(node|documentNode|site|[a-zA-Z]+)\.context\.currentSite/',

What about PHP migrations here?

And we miss migrations for currentRenderingMode at all.

/**
* ContentContext
*/
// ContentContext::getCurrentSite
// TODO: PHP
$rectorConfig->rule(FusionContextCurrentSiteRector::class);
// TODO: Fusion
// ContentContext::getCurrentDomain
// TODO: PHP
// TODO: Fusion
// ContentContext::getCurrentSiteNode
// TODO: PHP
// TODO: Fusion
// ContentContext::isLive -> Neos.Node.isLive(...)
// TODO: PHP
$rectorConfig->rule(FusionContextLiveRector::class);
// ContentContext::isInBackend -> Neos.Node.inBackend(...)
// TODO: PHP
$rectorConfig->rule(FusionContextInBackendRector::class);
// ContentContext::getCurrentRenderingMode
// TODO: PHP
// TODO: Fusion

@ahaeslich
Copy link
Member

@mficzel updated some old migrations already before deleting the eel helper we temporarily used. So yes information in this package might be outdated.

@mficzel
Copy link
Member

mficzel commented Sep 30, 2023

Migration seems right but I probably did not adjust the comment

@dlubitz
Copy link
Contributor

dlubitz commented Oct 2, 2023

That's right. I already cleaned that up: #27

But they are just for fusion and for example node.context.currentRenderingMode is still not covered, right?

Also the other ContentContext methods might need some rector rewrites?

@mficzel
Copy link
Member

mficzel commented Oct 2, 2023

Yes. We should migrate currentRendering mode aswell.

mficzel added a commit that referenced this issue Oct 4, 2023
For `node`,`site` and `documentNode` the expressions are migrated if `context.currentRenderingMode` is used on other values a comment is added

Resolves: #23
mficzel added a commit that referenced this issue Oct 4, 2023
Statements accessing `context.currentRenderingMode.edit|preview|name|title|fusionPath|options` on `node|site|documentNode` are migrated. Other uses of `context.currentRenderingMode` are marked with a comment.

Resolves: #23
mficzel added a commit that referenced this issue Oct 4, 2023
Statements accessing `context.currentRenderingMode.edit|preview|name|title|fusionPath|options` on `node|site|documentNode` are migrated. Other uses of `context.currentRenderingMode` are marked with a comment.

Resolves: #23
mficzel added a commit that referenced this issue Oct 5, 2023
Statements accessing `context.currentRenderingMode.edit|preview|name|title|fusionPath|options` on `node|site|documentNode` are migrated. Other uses of `context.currentRenderingMode` are marked with a comment.

Resolves: #23
@github-project-automation github-project-automation bot moved this from Todo to Done ✅ in Neos 9.0 Release Board Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
4 participants