[TYPO3-english] page called WITH pagetype is empty

Jennifer Koenig jenka13all at gmail.com
Thu Oct 22 16:23:02 CEST 2015


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??)

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.




More information about the TYPO3-english mailing list