Coder Social home page Coder Social logo

Comments (10)

helhum avatar helhum commented on June 15, 2024

Thanks for the report.
Please elaborate.

What kind of action is the one that generates the URI via {h:uri.ajaxAction()}, cached or uncached?
To what kind of action is the Ajax URI generated for, cached or uncached?

e.g. like this: listAction (cached) has a template with {h:uri.ajaxAction(action: 'detail')} and detailAction is uncached.

Are all actions within the same plugin?
Can you provide code to reproduce?

from typoscript_rendering.

InvisibleKind avatar InvisibleKind commented on June 15, 2024

Hi,

Thank you for fast answer.
I'm rendering an URI from uncached to cached action, both within same plugin and controller.

One thing to take into account: I'm using an own View for an ajax-Action.

To make it easier to reproduce, I've created a test extension: https://github.com/InvisibleKind/my_ajax_test

In current state, the link is built by uncached init action to cached ajax action, and leads to result, described in an issue above.
But If you add ajax to a list of uncached actions, then the output is as expected.

from typoscript_rendering.

helhum avatar helhum commented on June 15, 2024

To make it easier to reproduce, I've created a test extension:

awesome, thanks. But can you actually reproduce this error with your test extension?

I set up a blank TYPO3 8.7.1 instance (PHP 7.1) with just typoscript_rendering and your test extension and everything works as expected. What do I miss?

from typoscript_rendering.

InvisibleKind avatar InvisibleKind commented on June 15, 2024

So you're receiving only ["myValue"] as HTTP response body?

Then it is strange. There is nothing special in my installation, it is a composer-installed version, which runs in nginx/php-fpm Docker setup, if that matters.

Here is a bit anonymized composer.json

{
  "name": "name/name",
  "description": "Description",
  "license": "GPL-2.0+",
  "minimum-stability": "stable",
  "repositories": [
    {
      "type": "composer",
      "url": "https://composer.typo3.org/"
    }
  ],
  "config": {
    "vendor-dir": "vendor",
    "bin-dir": "bin",
    "cache-dir": "composer-cache",
    "github-oauth": {
      "github.com": "token"
    }
  },
  "require": {
    "php": "~7.1",
    "typo3/cms": "^8.0",
    "fluidtypo3/vhs": "^4.2",
    "helhum/typo3-console": "^4.5",
    "helhum/typoscript-rendering": "^2.0",
    "phpoffice/phpexcel": "^1.8",
    "dmitryd/typo3-realurl": "^2.2",
    "koninklijke-collective/my-redirects": "^3.3",
    "ichhabrecht/content-defender": "^1.0"
  },
  "require-dev": {
    "phpunit/phpunit": "5.7.*"
  },
  "extra": {
    "typo3/cms": {
      "web-dir": "web"
    },
    "helhum/typo3-console": {
      "install-extension-dummy": false
    }
  },
  "autoload": {
    "psr-4": {
      "My\\MyAjaxTest\\": "web/typo3conf/ext/my_ajax_test/Classes/"
    }
  }
}

from typoscript_rendering.

helhum avatar helhum commented on June 15, 2024

Thanks. Please try to reproduce it yourself in your environment, but a blank TYPO3 installation.

So you're receiving only ["myValue"] as HTTP response body?

yes

from typoscript_rendering.

InvisibleKind avatar InvisibleKind commented on June 15, 2024

Sooo... Finally I've found a reason. Tried almost the same setup with Laravel Homestead, and it surprisingly worked for me. So I've started to play around with Xdebug and phpStorm, and after long session, I've discovered, that problem is in \TYPO3\CMS\Frontend\Http\RequestHandler::handleRequest() and following block:

$this->controller->generatePage_preProcessing();
$temp_theScript = $this->controller->generatePage_whichScript();
if ($temp_theScript) {
    include $temp_theScript;
}

In case of Homestead, if was returning true. In case of my initial setup - false.
The problem is, that \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::generatePage_whichScript gives null because I'm setting $GLOBALS['TYPO3_CONF_VARS']['FE']['noPHPscriptInclude'] to true in my LocalConfiguration.php.

Quick fix would be set noPHPscriptInclude to false, but generatePage_whichScript is marked as @deprecated so we need some long-term solution.
Do you have any ideas for it?

from typoscript_rendering.

helhum avatar helhum commented on June 15, 2024

Quick fix would be set noPHPscriptInclude to false

hm, ok. Good catch. Can you create a pull request for this?

generatePage_whichScript is marked as @deprecated so we need some long-term solution

true

Do you have any ideas for it?

no, not yet. But I talked to @bmack already, that we will need something in TYPO3 9.x.
In the best case things like that will work out of the box, but we have to see what can be done for this TYPO3 version

from typoscript_rendering.

InvisibleKind avatar InvisibleKind commented on June 15, 2024

Sorry, took me too long to get how to properly write functional test to catch this situation, but finally PR is there ;)

from typoscript_rendering.

InvisibleKind avatar InvisibleKind commented on June 15, 2024

Ok, now the build fails for TYPO3 7 und lower with exactly same test failure, which should be fixed. Going to reproduce it locally and put me head on it.

from typoscript_rendering.

InvisibleKind avatar InvisibleKind commented on June 15, 2024

Now finally done :)

Short question though: can I somehow execute the codestyle-check locally before push?

from typoscript_rendering.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.