SteveLeg
SteveLeg

Reputation: 89

Extending extension with new actions

I'm migrating from 6.2 to 7.6 and I'm struggling with an extension(A) that extends another extension (b) that extends News (A-->B-->News). Everything is OK in 6.2 but not in 7.6.

I'm calling my action from Typoscript (lib.news.nextEvent)

lib.news.nextEvent < .related
nextEvent  {
    switchableControllerActions {
          News {
            1 = nextEventList
          }
    }

    settings {
        startingpoint = 123
        limit = 15

    link {
            skipControllerAndAction = 1
        }
    }
}

I have this error

Oops, an error occurred! Code: 201812181555070cca4167 - {"exception":"exception 'TYPO3\\CMS\\Extbase\\Mvc\\Exception\\NoSuchActionException' with message 'An action \"nextEventListAction\" does not exist in controller \"Roquin\\RoqNewsevent\\Controller\\EventController\"

TypoScript\setup.txt

config.tx_extbase {
    objects {
        Roquin\RoqNewsevent\Controller\EventController {
            className = QcMedia\QmNewsExtended\Controller\NewsExtendedController
        }
    }
}

In my controller i have (not the full actual class)

NewsExtendedController.php

use Roquin\RoqNewsevent\Controller\EventController;

class NewsExtendedController extends EventController

public function nextEventListAction(array $overwriteDemand = NULL)

Can someone give me a hint about that error? Thanks

Upvotes: 0

Views: 1483

Answers (2)

Steffen M&#228;chtel
Steffen M&#228;chtel

Reputation: 1021

Depending on which version of roq_newsevent you are use, the namespace is different in case:

TYPO3 Extension Repository 3.1.1:

ROQUIN\RoqNewsevent\Controller

Fork from visol/ext-roq_newsevent 3.3.0:

Roquin\RoqNewsevent\Controller

This should not be a problem, but i am not sure about the implementation in TYPO3.

config.tx_extbase {
    objects {
        ROQUIN\RoqNewsevent\Controller\EventController {
            className = QcMedia\QmNewsExtended\Controller\NewsExtendedController
        }
    }
}

You can try use XCLASS in ext_localconf.php instead of TypoScript config.tx_extbase.XXX

$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['ROQUIN\\RoqNewsevent\\Controller\\EventController'] = [
   'className' => 'QcMedia\\QmNewsExtended\\Controller\\NewsExtendedController'
];

Upvotes: 1

Artur Cichosz
Artur Cichosz

Reputation: 1054

There is nothing more to do apart extending the controller class and declaring the extended controller className in Typo3 setup which you did correctly.

If your class name QcMedia\QmNewsExtended\Controller\NewsExtendedController is correct and the extension QmNewsExtended is correctly installed, there might be an issue with your caches. Did you clear all caches including the autoload rebuild?

Upvotes: 0

Related Questions