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: Replace usage of Neos.Node.inBackend(node) #3571

Closed
wants to merge 1 commit into from

Conversation

mficzel
Copy link
Member

@mficzel mficzel commented Jul 9, 2023

Resolves partly neos/neos-development-collection#4396

This pr replaces usage of Neos.Node.inBackend(node) which is removed here neos/neos-development-collection#4067 with Neos.Backend.isEditMode(request) || Neos.Backend.isPreviewMode(request)

To verify you can run the ui with the branch neos/neos-development-collection#4067 be aware that the changes to adjust the ui to the separation of the edit and preview endpoints are not part of this pr.

@mficzel mficzel changed the title TASK: Replace usage of Neos.Node.inBackend(node) with Neos.Backend.isEditMode(request) || Neos.Backend.isPreviewMode(request) TASK: Replace usage of Neos.Node.inBackend(node) Jul 9, 2023
@mficzel mficzel changed the title TASK: Replace usage of Neos.Node.inBackend(node) TASK: Replace usage of Neos.Node.inBackend(node) Jul 9, 2023
….isEditMode(request) || Neos.Backend.isPreviewMode(request)`
@mficzel mficzel force-pushed the 90-replace-node-inbackend-usage branch from 0d7337d to 57a5bc1 Compare July 9, 2023 14:12
@mhsdesign
Copy link
Member

even if this is more explicit, i wonder if its enough to either A: mostly use Neos.Backend.isEditMode(request) or reduce code written by introducing Neos.Backend.isBackend(request)

@mficzel
Copy link
Member Author

mficzel commented Jul 9, 2023

@mhsdesign i think asking for "are you edit or preview mode" is much more explicit. I also thought about a separate inBackend method that returns (self::isEditMode(request) || self::isPreviewMode()) but abstained for now as i do not like the semantic of inBackend as beeing either edit or preview.

BTW: The previous semantic of Neos.Node.inBackend was even worse as it only checked that the node was not live.

Copy link
Contributor

@grebaldi grebaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to test this successfully with #3571.

I included this change over there.

I'm not sure how to go about this. This PR cannot be merged without neos/neos-development-collection#4067 over at neos-development-collection having been merged first. neos/neos-development-collection#4067 however cannot be merged without further changes in the UI (see: ce395ca).

I would therefore suggest to close this PR in favor of #3571.

@mficzel
Copy link
Member Author

mficzel commented Sep 12, 2023

Close this here as this needs to be redone.

@mficzel mficzel closed this Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants