Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The controller is not allowed by this plugin

I try to add a new controller which has one action called confirmAgbAction.

<?php
namespace Eddcapone\MyExtension\Controller;

/**
 * CustomController
 */
class CustomController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController 
{

    /**
     * action list
     *
     * @return void
     */
    public function confirmAgbAction()
    {
        echo "<p>HALLO WELT</p>";    
    }
}

I even added it to ext_localconf.php

<?php
if (!defined('TYPO3_MODE')) {
    die('Access denied.');
}

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    'Eddcapone.' . $_EXTKEY,
    'Myfilelist',
    array(
        'Category' => 'list,show',
        'File' => 'show',
        'Download' => 'download',
        'Custom' => 'confirmAgb'
    ),
    // non-cacheable actions
    array(
        'Category' => 'list,show',
        'File' => 'topFive',
        'Download' => 'download',
        'Custom' => 'confirmAgb'
    )
);

This is how I call the action in the template:

<f:link.action controller="Custom" action="confirmAgb" pluginName="Myfilelist" class="mbButton">Download</f:link.action>

However, i always get:

#1313855173: The controller "Custom" is not allowed by this plugin. Please check for TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin() in your ext_localconf.php.

like image 387
Black Avatar asked Nov 16 '25 21:11

Black


2 Answers

There are two common possibilities for your error:

  1. You use a flexform to embed your plugin. Either you have not added Custom->confirmAgb to the allowed calls in your flexform or you have added it but did not update the plugin (plugin configuration only updates when you save the plugin/tt_content element)
  2. You have two plugins on the page and the error is triggered by the other plugin because there the controller->action combination is not allowed.

PS: try adding this to your TS (setup.txt) and the plugins now should pick the default action if the given one is not found:

plugin.tx_yourextensionmvc.callDefaultActionIfActionCantBeResolved = 1

There could be more uncommon cases

like image 93
Dimitri L. Avatar answered Nov 18 '25 11:11

Dimitri L.


You should absolutely avoid using $_EXTKEY in configurePlugin and other Extbase contexts. Extbase requires the Vendor.ExtensionName format - $_EXTKEY is in the lowercase_underscored format. Defining those parameters as hardcoded values should solve your problem with resolving controllers for your given plugin.

To be precise: use Eddcapone.Myextension as extension name parameter in your command(s) to register/configure plugins.

like image 42
Claus Due Avatar answered Nov 18 '25 12:11

Claus Due



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!