[TYPO3-english] page called WITH pagetype is empty

bernd wilke t3ng at bernd-wilke.net
Mon Oct 26 09:04:16 CET 2015


Am 22.10.15 um 16:23 schrieb Jennifer Koenig:
> I want to use AJAX to call a method in my controller. The AJAX call
> returns "Sucess" and a status of 202, however, only an empty string.
> Here's my code... (by the way, if "BBCode is off" how do I turn it ON??)

never. as the forum is mirrored to Newsgroups and mailinglist where 
those tags were not interpreted.

>
> ajax.ts
> -----------------------
> [code]
> ajaxPage = PAGE
> ajaxPage {
> typeNum = 1443694741
> config {
> no_cache = 1
> disableAllHeaderCode = 1
> disableCharsetHeader = 1
> xhtml_cleaning = 0
> additionalHeaders = Content-Type: application/json; charset=UTF-8
> no_cache = 1
> }
> 10 = USER
> 10 {
> userFunc = tx_extbase_core_bootstrap->run
> extensionName = Myext
> pluginName = Myplugin
> vendorName = Myvendor
>
> switchableControllerActions {
> Booking {
> 1 = checkAvailable
> }
> }
> }
> }
> [/code]
>
> checkAvailable.js
> --------------------
> [code]
> ..
> checkAvailable: function () {
> var controller = 'Booking';
> var action = 'checkAvailable';
> var pageType = 1443694741;
>
> $.ajax({
>
> url: "index.php",
> dataType: 'text',
>
> data: "id=19&tx_myext_myplugin[controller]=" + controller +
> "&tx_myext_myplugin[action]=" + action
> + "&type=" + pageType,
>
> success: function (result) {
> console.log('success');
> console.log(result);
> },
>
> error: function (error) {
> console.log("error: ");
> console.log(error.status);
> console.log(error.statusText);
> },
> ..
> [/code]
>
> BookingController.php
> -----------
> [code]
> public function checkAvailableAction() {
> return "Successful AJAX call";
> }
> [/code]
> ------------
>
> The URL that gets generated by the AJAX call is this:
>
> http://mydomain/index.php?id=19&tx_myext_myplugin[controller]=Booking&tx_myext_myplugin[action]=checkAvailable&type=1443694741
>
>
> The page is empty and without source code. AJAX tells me that the call
> was succssful, with a status of 202, and returns an empty string instead
> of what's in my controller.
>
> When I call this generated URL without the "type", I get a page with the
> data from this (and the other) plugins. Is it because of the page, since
> it has more than one plugin on it?
>
> It seems like the controller isn't even being called by AJAX. I'm
> working with TYPO3 7.4, or else I would use devlog to tell me if the
> controller ever even gets entered.
>
> Does anyone have an idea where I could start debugging this? In PHP log
> there are NO errors and no warnings when this page is called.

1. test wether your pagetype is called at all:
intert
ajaxPage.20 = TEXT
ajaxPage.20.value = back from AjaxPageType

then you may provide a logging in your ajaxpage.
log all the _GET/_POST-vars

log wether your plugin is called
what your plugin thinks to return

if you can not output to screen, you may use a fixed file /tmp/typo3.log 
or <webroot>/fileadmin/ajax.log or ...


bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list