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] Refactor pagination #3097

Closed
wants to merge 32 commits into from
Closed

[TASK] Refactor pagination #3097

wants to merge 32 commits into from

Conversation

FamousWolf
Copy link
Contributor

What this pr does

Remove pagination widget and replace with the TYPO3 pagination API

Fixes: #3091

dkd-kaehm and others added 16 commits October 29, 2021 12:21
This change contains changes for back-end module templates
related to Bootstrap 5 changes.

Relates: #2977
Fixes: #2976
This change contains basic fixes for TSFE initialization.

Relates: #2977
Fixes: #2976
This breaks the collabse functionality in v10

Relates: #2976
Relative path does not work anymore

Relates: #2976
…dController

The pageIndexing hook has been removed, see https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.4/Deprecation-91012-VariousHooksRelatedToTypoScriptFrontendController.html

The suggestion is to use $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached'], but it's not executed because
\ApacheSolrForTypo3\Solr\Middleware\FrontendUserAuthenticator disables caching.

This commit switches to $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'] which is always executed.

With this pages indexing works (again).

Relates: #2976
TYPO3 by default enables a preview mode if a backend user is logged in,
the VisibilityAspect is configured to show hidden elements.

Due to this setting hidden relations/translations might be indexed
when running the Solr indexer via the TYPO3 backend.

To avoid this, the VisibilityAspect is adapted for indexing.

Resolves: #3046
Relates: #3050, #2976
Notes:

* Replaces `GeneralUtility::isFirstPartOfStr()` with 
   PHP8(or Symfony Polyfills 8.0) `str_starts_with()`  

Fixes: #3089
Relates: #2976, #2977
This change contains array key access fixes only.

Fixes: #3089
Relates: #2976, #2977
* TYPO3 11 LTS uses native Guzzle PSR-18 implementation 
   See: TYPO3/typo3@997c066

Fixes: #3092
Relates: #2976, #2977
@FamousWolf FamousWolf marked this pull request as ready for review November 17, 2021 15:53
@dkd-kaehm dkd-kaehm changed the base branch from task/2976_TYPO3.11_compatibility to release-11.5.x November 19, 2021 08:17
@dkd-kaehm dkd-kaehm changed the base branch from release-11.5.x to task/2976_TYPO3.11_compatibility November 19, 2021 08:22
@dkd-kaehm dkd-kaehm force-pushed the task/2976_TYPO3.11_compatibility branch from 5de0475 to 78c0358 Compare November 22, 2021 07:15
The initialization of TSFE within indexing and  Backens modules contexts is refactored.

In this change the setting and usage of $GLOBALS['TSFE'] is removed and replaced by TYPO3s Core Context API.
The "Context" is always cloned instead of using its singleton instance.
The "Context", "Language", "TSFE" and "ServerRequest", which are required for TypoScript parsing in BE-modules and indexing contexts, are highly isolated/capsuled and not visible anymore for all things not belonging to EXT:solr internals.

Byside of isolation/capsulation of TSFE, the language handling is restored 
to pure and default EXT:solr "fallback" mode approach. 
So all page records, which are involved in indexing(All page types and above all all with sys_template or records-to-index), must be translated. Otherwise the translation records will be indexed in default language.

Note: Since TYPO3 11 LTS does not allow to instanciate TSFE for sys folders and spacer, the initialization of TSFE will be done for first and closest page(not spacer or folder) within the site rootline.  

Note: This change is not a final state of EXT:solr 11.5.x 

Fixes: #3092, 3065
Relates: #2976, #2977
With this change, the root pages of configured sites are imported by default, if `writeDefaultSolrTestSiteConfiguration()` is called.

To skip the import of records for root pages, the test class property  $skipImportRootPagesAndTemplatesForConfiguredSites must be set to false.

To add or override TypoScript setting please use following typo3/testing-framework methods:
* `addTypoScriptToTemplateRecord()`
* `setUpFrontendRootPage()`

The usage of this feature will be implemented in subsequent commits. 

Fixes: #3092
Relates: #2976, #2977
This change was dependent on https://review.typo3.org/c/Packages/TYPO3.CMS/+/72249, which is already merged and will be available from TYPO3 version 11.5.4+
Christoph Lehmann and others added 3 commits November 27, 2021 14:28
In previous releases of EXT:solr the language handling for "free-content-mode" inconsistent. 
The behavior of "free-content-mode" related records varied in RecordMonitor, Initializing and Indexing contexts, 
which was the source of troubles for mixing overlay records in wrong cores/languages.

This change brings the RecordMonitor, Initializing and Indexing contexts for "free-content-mode" related records 
into the same line, so the "free-content-mode" records are processed the same way.

## About "free-content-mode"-records from TYPO3 docs:
> "Fall back to other language, if the page does not exist in the requested language.
> But always fetch only records of this specific (available) language."
> "TYPO3 will directly fetch the translated records and not care about the records in the default language at all."



Fixes: #2788
Ralates: #2504,
This change fixes several troubles concerning "Hide default language" 
behavior of RecordMonitor processes.

Previously the EXT:solr approach of TSFE initialization and subsequently
applied side-effects for changing language context did not allow proper
retrieval of TypoScript configuration, required by RecordMonitor.
Current implementation of isolated/capsuled TSFE objects allows to
fallback to TSFE in any active site language, and therefore to retrieve 
the EXT:solr TypoScript configuration within TYPO3 BE requests 
even a single non default language is available in site.

Despite all the current improvements the whole TSFE stack must be refactored
to proper bounded contexts facility avoiding hard dependencies
and service locator disadvantages.
The TSFE is involved in following contexts:
* TYPO3 BE without hard dependency to site language
** ReocordMonitor
** Queue initialization
* Indexing with hard dependency to site language
** within BE-Web context
** CLI
In all that contexts the "TSFE" Initialization and usage MUST NOT interfere 
with TYPO3 processes but MUST provide reliable dependency injection
for all EXT:solr components requiring TypoScript configuration.


Fixes: #2983, #2452, #2171, #1396, #1395, #1374
@dkd-kaehm dkd-kaehm force-pushed the task/2976_TYPO3.11_compatibility branch from 78c0358 to ad5c0d2 Compare November 27, 2021 19:53
@dkd-kaehm dkd-kaehm force-pushed the task/2976_TYPO3.11_compatibility branch from 17cdf57 to 0a5aa9d Compare November 27, 2021 22:08
@dkd-kaehm
Copy link
Collaborator

@FamousWolf
Thanks for fixing the pagination part.
I've cherry-picked that PR in the target branch. Please use new pull request for rest of widget stuff.

@dkd-kaehm dkd-kaehm closed this Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants