diff --git a/src/ContentRepository90/Rules/FusionContextInBackendRector.php b/src/ContentRepository90/Rules/FusionContextInBackendRector.php index ebcc196..7abd7d8 100644 --- a/src/ContentRepository90/Rules/FusionContextInBackendRector.php +++ b/src/ContentRepository90/Rules/FusionContextInBackendRector.php @@ -20,12 +20,12 @@ public function refactorFileContent(string $fileContent): string return EelExpressionTransformer::parse($fileContent) ->process(fn(string $eelExpression) => preg_replace( '/(node|documentNode|site)\.context\.inBackend/', - 'Neos.Node.inBackend($1)', + 'userInterfaceMode.isEdit', $eelExpression )) ->addCommentsIfRegexMatches( '/\.context\.inBackend/', - '// TODO 9.0 migration: Line %LINE: You very likely need to rewrite "VARIABLE.context.inBackend" to Neos.Node.inBackend(VARIABLE). We did not auto-apply this migration because we cannot be sure whether the variable is a Node.' + '// TODO 9.0 migration: Line %LINE: You very likely need to rewrite "VARIABLE.context.inBackend" to "userInterfaceMode.isEdit". We did not auto-apply this migration because we cannot be sure whether the variable is a Node.' )->getProcessedContent(); } } diff --git a/src/ContentRepository90/Rules/FusionContextLiveRector.php b/src/ContentRepository90/Rules/FusionContextLiveRector.php index 3d2fed9..d754a9e 100644 --- a/src/ContentRepository90/Rules/FusionContextLiveRector.php +++ b/src/ContentRepository90/Rules/FusionContextLiveRector.php @@ -20,12 +20,12 @@ public function refactorFileContent(string $fileContent): string return EelExpressionTransformer::parse($fileContent) ->process(fn(string $eelExpression) => preg_replace( '/(node|documentNode|site)\.context\.live/', - 'Neos.Node.isLive($1)', + 'userInterfaceMode.isLive', $eelExpression )) ->addCommentsIfRegexMatches( '/\.context\.live/', - '// TODO 9.0 migration: Line %LINE: You very likely need to rewrite "VARIABLE.context.live" to Neos.Node.isLive(VARIABLE). We did not auto-apply this migration because we cannot be sure whether the variable is a Node.' + '// TODO 9.0 migration: Line %LINE: You very likely need to rewrite "VARIABLE.context.live" to "userInterfaceMode.isLive". We did not auto-apply this migration because we cannot be sure whether the variable is a Node.' )->getProcessedContent(); } } diff --git a/tests/ContentRepository90/Rules/FusionContextInBackendRector/Fixture/some_file.fusion.inc b/tests/ContentRepository90/Rules/FusionContextInBackendRector/Fixture/some_file.fusion.inc index caece89..02f645c 100644 --- a/tests/ContentRepository90/Rules/FusionContextInBackendRector/Fixture/some_file.fusion.inc +++ b/tests/ContentRepository90/Rules/FusionContextInBackendRector/Fixture/some_file.fusion.inc @@ -30,7 +30,7 @@ prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Fie } } ----- -// TODO 9.0 migration: Line 26: You very likely need to rewrite "VARIABLE.context.inBackend" to Neos.Node.inBackend(VARIABLE). We did not auto-apply this migration because we cannot be sure whether the variable is a Node. +// TODO 9.0 migration: Line 26: You very likely need to rewrite "VARIABLE.context.inBackend" to "userInterfaceMode.isEdit". We did not auto-apply this migration because we cannot be sure whether the variable is a Node. prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Field) { renderer = Neos.Fusion:Component { @@ -38,7 +38,7 @@ prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Fie # # pass down props # - attributes = ${Neos.Node.inBackend(node) || Neos.Node.inBackend(site) || Neos.Node.inBackend(documentNode)} + attributes = ${userInterfaceMode.isEdit || userInterfaceMode.isEdit || userInterfaceMode.isEdit} # # the `checked` state is calculated outside the renderer to allow` overriding via `attributes` @@ -54,10 +54,10 @@ prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Fie renderer = afx` ` } diff --git a/tests/ContentRepository90/Rules/FusionContextLiveRector/Fixture/some_file.fusion.inc b/tests/ContentRepository90/Rules/FusionContextLiveRector/Fixture/some_file.fusion.inc index 27bbb94..b0c468d 100644 --- a/tests/ContentRepository90/Rules/FusionContextLiveRector/Fixture/some_file.fusion.inc +++ b/tests/ContentRepository90/Rules/FusionContextLiveRector/Fixture/some_file.fusion.inc @@ -30,7 +30,7 @@ prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Fie } } ----- -// TODO 9.0 migration: Line 26: You very likely need to rewrite "VARIABLE.context.live" to Neos.Node.isLive(VARIABLE). We did not auto-apply this migration because we cannot be sure whether the variable is a Node. +// TODO 9.0 migration: Line 26: You very likely need to rewrite "VARIABLE.context.live" to "userInterfaceMode.isLive". We did not auto-apply this migration because we cannot be sure whether the variable is a Node. prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Field) { renderer = Neos.Fusion:Component { @@ -38,7 +38,7 @@ prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Fie # # pass down props # - attributes = ${Neos.Node.isLive(node) || Neos.Node.isLive(site) || Neos.Node.isLive(documentNode)} + attributes = ${userInterfaceMode.isLive || userInterfaceMode.isLive || userInterfaceMode.isLive} # # the `checked` state is calculated outside the renderer to allow` overriding via `attributes` @@ -54,10 +54,10 @@ prototype(Neos.Fusion.Form:Checkbox) < prototype(Neos.Fusion.Form:Component.Fie renderer = afx` ` }