georgringer / news

TYPO3 Extension news
GNU General Public License v2.0
264 stars 358 forks source link

[BUGFIX] Use FlexFormTools to clean up flexforms in plugin updater #2173

Closed eliashaeussler closed 1 year ago

eliashaeussler commented 1 year ago

By using the FlexFormTools->cleanFlexFormXML() method, registered hooks for flexform modifications are also taken into account. Without its usage, those additional fields would get removed during an upgrade.

Resolves: #2172

liayn commented 1 year ago

I justed tested dev-main again, but unfortunately this now leads to: PHP Warning: Undefined global variable $LANG in /var/www/html/vendor/typo3/cms-form/Classes/Hooks/DataStructureIdentifierHook.php line 403

So we have a hook in Core, that assumes $GLOBALS['LANG'] is present. What shall we do? Init $LANG? Fix Core?

DavidBruchmann commented 1 year ago

It's very unlikely that $GLOBALS['LANG'] will be re-introduced in the core.

liayn commented 1 year ago

It's very unlikely that $GLOBALS['LANG'] will be re-introduced in the core.

Not sure what you mean? I'm testing on v11 here, so Core is using it by itself. The fix in v11 Core would be to not rely on the global an fallback to creating a dedicated instance of the LanguageService.

Besides that: The fix does not work with eventnews v6 currently. I'm still investigating this.

liayn commented 1 year ago

Note:

What shall we do? Init $LANG? Fix Core?

Initializing $GLOBALS['LANG'] in the PluginUpdater helps to mitigate the problem in v11 at least.

Besides that: The fix does not work with eventnews v6 currently. I'm still investigating this.

Something is wrong with the generated DS somehow.

DavidBruchmann commented 1 year ago

anyway, it's then an issue for the form extension and not directly related to news.

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/10.0/Deprecation-88567-GLOBALS_LOCAL_LANG.html?highlight=globals%20lang

liayn commented 1 year ago

anyway, it's then an issue for the form extension and not directly related to news.

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/10.0/Deprecation-88567-GLOBALS_LOCAL_LANG.html?highlight=globals%20lang

$GLOBALS['LOCAL_LANG'] vs. $GLOBALS['LANG'] :-)

It is an issue of news here too, because it is using the Flexform stuff outside the expected context. The ext-form hook never expected to be called in an install-tool-context. So, I'd say we have to cope with this in news.

DavidBruchmann commented 1 year ago

concerning the DS Elias provided just a PR which is already merged I think, not sure if this could be related

liayn commented 1 year ago

The problem is actually: https://github.com/georgringer/eventnews/commit/c3331375400c9acca951fe21542e7adefab45480 It would need the TCEforms nesting to work correctly

DavidBruchmann commented 1 year ago

ahh this change :/

liayn commented 1 year ago

The ext:form issue is solved with: https://github.com/georgringer/news/pull/2197

IchHabRecht commented 1 year ago

For me the creation of LanguageService failed in a current TYPO3 12.4 installation. I added another pull request: https://github.com/georgringer/news/pull/2199