lochmueller / calendarize

📆 Best TYPO3 Calendar ever 📆
http://typo3.org/extensions/repository/view/calendarize
75 stars 84 forks source link

storagePid in a multi-microsite scenario #747

Open Make66 opened 1 year ago

Make66 commented 1 year ago

I plan to create a view hundred sites using all the same structure based on a "template" page tree: a) use template page tree for the design and template and content elements b) use individual site page tree for navigation and configuration only. Linking to a) by "Show Content from Page[content_from_pid]" in page properties/Appearance

So I create a news CE in a) and set plugin.tx_news.settings.startingpoint in b) call b) in browser and all works fine (old base cal worked fine as well)

Now I put a calendarize-listonly in a) and TS setup in b) like "plugin.tx_calendarize.persistence.storagePid =" or put a constant like "calStoragePid" in b) and resolve it in a), but no events are found. I did verify to have current event/indexes in respective pid.

Is my approach somehow clever or should I solve this differently?

lochmueller commented 1 year ago

The idea is right, but currently not possible. I try that the storage configuration will be part of the next release.

Make66 commented 1 year ago

I'll be glad to test. Will Pizza help?

lochmueller commented 1 year ago

Thanks, but I need time and no pizza ;)

rteitge commented 1 month ago

Hi there,

the problem here seems to be that the TS settings are overridden by the flexform ones. Even if the flexform ones are empty. We had the same problem with felogin (there are/were also issues in forge about that). It occures in typo3 v10 and v11. It's fixed in v12, but can't be backported to v11. So we tested it with calendarize v12.4.4, there should be no problem with v13 (hopefully :smile:).

Bildschirmfoto vom 2024-05-09 21-43-47 As you can see here, persistence.storagePid is empty even it's been set in TS settings. The workaround for this is to call the full TS config if the flexform storagePid is empty. It's not beautiful but it works:

commit db46a7c8dd4c1d1a62e51fe8c742c1854b9321cd (HEAD)
Author: rteitge <roman@teitge.info>
Date:   Thu May 9 21:21:29 2024 +0200

    workaround storagePid

diff --git a/Classes/Domain/Repository/IndexRepository.php b/Classes/Domain/Repository/IndexRepository.php
index 861c2ec..4c622b1 100644
--- a/Classes/Domain/Repository/IndexRepository.php
+++ b/Classes/Domain/Repository/IndexRepository.php
@@ -610,6 +610,15 @@ class IndexRepository extends AbstractRepository
             ',',
             $frameworkConfig['persistence']['storagePid']
         ) : [];
+        if ($frameworkConfig['persistence']['storagePid'] != '' && !empty($storagePages)) {
+            return $storagePages;
+        }
+        $fullConfig = $configurationManager
+            ->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT)["plugin."]["tx_calendarize."];
+        $storagePages = isset($fullConfig['persistence.']['storagePid']) ? GeneralUtility::intExplode(
+            ',',
+            $fullConfig['persistence.']['storagePid']
+        ) : [];
         if (!empty($storagePages)) {
             return $storagePages;
         }