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: #4396 prefer renderingMode::isEdit over node::isLive #4733

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Nov 12, 2023

Resolves partially #4396
Resolves: #2347

This refactors the isBackend checks in php land to use the defined renderingMode in fusion. Currently the content element wrapping service would otherwise check if the workspace is live and otherwise assume we are in the backend which is wrong. This would cause the content element wrapping to be needlessly rendered in the preview mode (this causes also issues like neos/neos-ui#3144)

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@kitsunet
Copy link
Member

Great idea, thanks!
Buuuuut hold on, this is sadly complicated :/

The chnge would result in rendered stuff in the frontend rendering as well, you might not have noticed this as it is dependent on the Frontendlogin package. If it's installed it prevents the backend user access from being available in the frontend rendering, but without it, this should trigger if your backend user last had selected an edit mode in the backend.

And that is not a desireable side effect.

@mhsdesign
Copy link
Member Author

Hmm you mean flowpack/neos-frontendlogin to be clear? I cant reproduce what you seem to have found.

@kitsunet
Copy link
Member

Yep nvm all good, this is prevented by the hardcoded renderingMode set via NodeController::showAction()

Copy link
Member

@kitsunet kitsunet left a comment

Choose a reason for hiding this comment

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

I guess fine then

@mhsdesign mhsdesign force-pushed the task/4396-preferRenderingModeIsEditChecksInsteadOfNodeIsLive branch from 73fb745 to faa72c7 Compare November 17, 2023 13:55
@mhsdesign mhsdesign merged commit e304fc6 into neos:9.0 Nov 17, 2023
4 checks passed
@mhsdesign mhsdesign deleted the task/4396-preferRenderingModeIsEditChecksInsteadOfNodeIsLive branch November 17, 2023 13:56
@dlubitz
Copy link
Contributor

dlubitz commented Dec 29, 2023

@mhsdesign It seems this changes breaks rendering of the 404 Not Found page in Neos Demo (Neos.Demo:Document.NotFoundPage)

Exception:

Fatal error: Uncaught AssertionError: assert($renderingMode instanceof RenderingMode) in /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Neos_Fusion_ConvertUrisImplementation.php:128 Stack trace: #0 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Neos_Fusion_ConvertUrisImplementation.php(128): assert(false, 'assert($renderi...') #1 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(527): Neos\Neos\Fusion\ConvertUrisImplementation_Original->evaluate() #2 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(479): Neos\Fusion\Core\Runtime_Original->evaluateObjectOrRetrieveFromCache(Object(Neos\Neos\Fusion\ConvertUrisImplementation), 'header<Neos.Dem...', Array, Array) #3 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(868): Neos\Fusion\Core\Runtime_Original->evaluate('header<Neos.Dem...', Object(Neos\Fusion\FusionObjects\JoinImplementation), 'Exception') #4 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(534): Neos\Fusion\Core\Runtime_Original->evaluateProcessors('<svg class="hid...', Array, 'header<Neos.Dem...', Object(Neos\Fusion\FusionObjects\JoinImplementation)) #5 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(479): Neos\Fusion\Core\Runtime_Original->evaluateObjectOrRetrieveFromCache(Object(Neos\Fusion\FusionObjects\JoinImplementation), 'header<Neos.Dem...', Array, Array) #6 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(314): Neos\Fusion\Core\Runtime_Original->evaluate('header<Neos.Dem...', NULL, 'Exception') #7 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_FusionObjects_ComponentImplementation.php(96): Neos\Fusion\Core\Runtime_Original->render('header<Neos.Dem...') #8 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_FusionObjects_ComponentImplementation.php(46): Neos\Fusion\FusionObjects\ComponentImplementation_Original->render(Array) #9 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(527): Neos\Fusion\FusionObjects\ComponentImplementation_Original->evaluate() #10 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(479): Neos\Fusion\Core\Runtime_Original->evaluateObjectOrRetrieveFromCache(Object(Neos\Fusion\FusionObjects\ComponentImplementation), 'header', Array, Array) #11 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(314): Neos\Fusion\Core\Runtime_Original->evaluate('header', NULL, 'Exception') #12 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_FusionObjects_RendererImplementation.php(58): Neos\Fusion\Core\Runtime_Original->render('header') #13 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(527): Neos\Fusion\FusionObjects\RendererImplementation_Original->evaluate() #14 /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Fusion_Core_Runtime.php(479): Neos\Fusion\Core\Runtime_Original->evaluateObjectOrRetrieveFromCache(Object(Neos\Fusion\FusionObjects\RendererImplementation), 'root<Neos.Fusio...', Array, Array) #15 /var/www/html/Packages/Neos/Neos.Fusion/Classes/FusionObjects/Helpers/LazyProps.php(69): Neos\Fusion\Core\Runtime_Original->evaluate('root<Neos.Fusio...', Object(Neos\Fusion\FusionObjects\ComponentImplementation)) #16 /var/www/html/Packages/Neos/Neos.Fusion/Classes/FusionObjects/Helpers/LazyProps.php(93): Neos\Fusion\FusionObjects\Helpers\LazyProps->offsetGet('header') #17 [internal function]: Neos\Fusion\FusionObjects\Helpers\LazyProps->current() #18 /var/www/html/Packages/Neos/Neos.Fusion/Classes/FusionObjects/Helpers/LazyProps.php(118): iterator_to_array(Object(Neos\Fusion\FusionObjects\Helpers\LazyProps)) #19 [internal function]: Neos\Fusion\FusionObjects\Helpers\LazyProps->jsonSerialize() #20 /var/www/html/Packages/Framework/Neos.Flow/Classes/Error/Debugger.php(478): json_encode(Object(Neos\Fusion\FusionObjects\Helpers\LazyProps), 512, 1) #21 /var/www/html/Packages/Framework/Neos.Flow/Classes/Error/Debugger.php(341): Neos\Flow\Error\Debugger::getObjectSnippetPlaintext(Object(Neos\Fusion\FusionObjects\Helpers\LazyProps)) #22 /var/www/html/Packages/Framework/Neos.Flow/Classes/Error/DebugExceptionHandler.php(130): Neos\Flow\Error\Debugger::getBacktraceCode(Array) #23 /var/www/html/Packages/Framework/Neos.Flow/Classes/Error/DebugExceptionHandler.php(81): Neos\Flow\Error\DebugExceptionHandler->renderStatically(404, Object(AssertionError)) #24 /var/www/html/Packages/Framework/Neos.Flow/Classes/Error/AbstractExceptionHandler.php(128): Neos\Flow\Error\DebugExceptionHandler->echoExceptionWeb(Object(Neos\Flow\Mvc\Controller\Exception\InvalidControllerException)) #25 [internal function]: Neos\Flow\Error\AbstractExceptionHandler->handleException(Object(Neos\Flow\Mvc\Controller\Exception\InvalidControllerException)) #26 {main} thrown in /var/www/html/Data/Temporary/Development/SubContextDdev/Cache/Code/Flow_Object_Classes/Neos_Neos_Fusion_ConvertUrisImplementation.php on line 128

Is this a Neos or Neos.Demo issue?

@mhsdesign
Copy link
Member Author

mhsdesign commented Jan 8, 2024

nope puuuhh i was not aware of that thanks ;)

#4824

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.

Node URIs are not converted in frontend preview of workspaces
4 participants