benjaminkott / bootstrap_package

Bootstrap Package delivers a full configured theme for TYPO3, based on the Bootstrap CSS Framework.
https://www.bootstrap-package.com/
MIT License
336 stars 200 forks source link

Controller action via typeNum not executed (depending on TS order) #1103

Open MacGyer opened 2 years ago

MacGyer commented 2 years ago

Support

TYPO3 Version: 10.4.21 Bootstrap Package Version: 11.0.3

Description

The extension provides static TS included via Template -> Includes and a custom page via typeNum for handling AJAX requests. The TS config is as follows:

plugin.tx_mobilityprojects_ajaxapi {
    persistence {
        storagePid = 3
    }
    settings {
        ajaxPageTypes {
            projectUserActions = 1964651634
        }
    }
}

mobilityprojects_projectuseractions = PAGE
mobilityprojects_projectuseractions {
    typeNum < plugin.tx_mobilityprojects_ajaxapi.settings.ajaxPageTypes.projectUserActions
    10 < tt_content.list.20.mobilityprojects_ajaxapi

    config {
        disableAllHeaderCode = 1
        additionalHeaders.10.header = Content-Type: application/json
        xhtml_cleaning = 0
        admPanel = 0
        debug = 0
        no_cache = 1
    }
}

The plugin provides a Controller class which has an action to render JSON (via \TYPO3\CMS\Extbase\Mvc\View\JsonView).

When the extension TS is included before Bootstrap Package TS, the Controller action is not executed (thus no JSON response). When the extension TS is included after Bootstrap Package TS, the action is executed and the JSON data is returned.

Any idea, why this happens? Or am I missing something very elementary in TS configuration, inheritance or similar?

Screenshots

Working: image

Not working: image

Thanks for getting back. If you need further information, please feel free to ask.

Cheers

gilbertsoft commented 2 years ago

I don't see a reason with the provided information. Maybe you can find it with the TypoScript Template Analyzer.

But I see other issues:

The Boostrap Package automatically includes the Indexed Search if found. So this code is included two times now, so remove it. You can also see that with the Template Analyzer.

If your Sitepackage was created with the Sitepackage Builder it will also include the Bootstrap Package setup and you can remove it too.

MacGyer commented 2 years ago

@gilbertsoft

Thanks for your hints. I removed the unnecessary includes.

The problem still exists, when the Mobility Projects TS is included before the Sitepackage TS (which contains Bootstrap Package TS). So I re-ordered the includes like follows:

image

gilbertsoft commented 2 years ago

I don't see a reason with the provided information. Maybe you can find it with the TypoScript Template Analyzer.

Still I don't have sufficient information...

MacGyer commented 2 years ago

Still I don't have sufficient information...

Sorry, didn't understand you requested me to check the Template Analyser.

I didn't find anything unusual in the TS regarding page types, json responses or similar. All looked quite normal to me. I have reproduced this behavior in another TYPO3 website with only a Sitepackage and Bootstrap Package installed.

Would it be useful if I provided the whole output of the Template Analyser?