TYPO3: Change plugin from USER to USER_INT type

亡梦爱人 提交于 2019-12-04 05:19:09

To disable caching for your extension go to your piX/class.tx_XXX_piX.php file and remove the following line (below your class declaration):

var $pi_checkCHash = true;

You also need to add the following line in the main method (below $this->pi_loadLL();):

$this->pi_USER_INT_obj=1;    // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!

grunwalski it's the opposite you have to change this:

t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',1);

to this:

t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',0);

The simpliest way to solve your problem is to go back to Extension Maganer, select your extension, choose "Edit in Kickstarter" from the dropdown menu, and then select the corresponding Frontend plugin to edit it's properties.

Check the first checkbox which means that you want your plugins to be rendered as USER_INT cObjects. After that click the View result button, uncheck all custom PHP files (your own code, like modules and plugins) on the right side and click the WRITE button. Please be careful. If you don't uncheck the checkboxes of your own files, they will be overwritten with dummy files.

The correct and comlete way to do this is a combination of the answers of @arturh and @Mehdi Guermazi:

  1. change the last parameter in the addPItoST43() call in ext_localconf.php from 1 to 0
  2. remove the var $pi_checkCHash = true; line from the property definitions in the head of the pi1 class.
  3. add the $this->pi_USER_INT_obj=1; line to the start of the main() function in pi1.

These changes are identical to what you will get when you use the kickstarter method explained in the solution of @bencuss.

When you have created your extension with Kickstarter you also have to go to the file [yourextension]/ext_localconf.php and change this line

t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',0);

to this:

t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',1);

Edit the file setup.txt of your extension "myext". Change "USER" into "USER_INT".

plugin.tx_myext = USER_INT
plugin.tx_myxt {

This extension will never be cached.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!