FriendsOfTYPO3 / frontend_editing

TYPO3 CMS Frontend Editing
https://friendsoftypo3.github.io/frontend_editing/
102 stars 38 forks source link

Editing of custom records (news) not possible #627

Closed h3nn3s closed 2 years ago

h3nn3s commented 2 years ago

Description: It is not possible to edit existing news records, when [FE][pageNotFoundOnCHashError] = true is set and routeEnhancers for news are configured. All configuration is based on build-in feature as documented here: https://docs.typo3.org/p/friendsoftypo3/frontend-editing/3.0/en-us/InlineEditing/Index.html?highlight=news#custom-record-editing

Without having a proper routeEnhancer for nice URL i get an 404-error for detail page. After adding a routeEnhancer and getting nice looking detail page URL i get an Exception at TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor->resolveHash('frontend_editing_already_loaded')

(1/1) #1537633463 OutOfRangeException
Hash not resolvable

Workaround: Set [FE][pageNotFoundOnCHashError] = false in LocalConfiguration.php

Solution: tbd

Environment: TYPO3: 11.5.12 PHP: 8.1 frontend_editing: 3.0.25 t3kit: dev-master news: 9.4.0

MattiasNilsson commented 2 years ago

@h3nn3s Did you manage to sort this out?

h3nn3s commented 2 years ago

nope, sorry. Admittedly, I didn't work on it anymore either. I was just doing some tests for a customer presentation and stumpled upon this issue.

rschwemm commented 1 year ago

I ran into this as well and the workaround sadly did not seem work for me.

The value of the constant FRONTEND_EDITING_ALREADY_LOADED in the FrontendEditingInitializationHook is 31 characters long: "frontend_editing_already_loaded". That is exactly one character too long for TYPO3. The limit of <31 characters is hardcoded in typo3/sysext/core/Classes/Routing/Enhancer/VariableProcessor.php:69 in the method resolveHash().

Simply picking a shorter value for the constant (such as "fe_editing_already_loaded") solves the issue. Alternatively, it should also be possible to register a hash for the parameter in the VariableProcessor. I didn't try it though.

MattiasNilsson commented 1 year ago

@rschwemm @h3nn3s A new version is out which solves the issue. https://github.com/FriendsOfTYPO3/frontend_editing/releases/tag/3.0.28