octobercms/october · error · ApplicationException

You must implement the controller behavior ListController…

Error message

You must implement the controller behavior ListController with the export 'useList' option enabled.

What it means

checkUseListExportMode, when export[useList] is enabled, requires the controller to also implement ListController (isClassExtendedWith); otherwise the export cannot reuse the list definition and this ApplicationException is thrown. Behavior composition is at fault.

Solutions

  1. Add \Backend\Behaviors\ListController to the controller's $implement array
  2. Remove export[useList] if list-based export isn't intended
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/behaviors/importexportcontroller/HasListExport.php:22 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/e81a7ce25375b738. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/behaviors/importexportcontroller/HasListExport.php:22

use Response;
use ApplicationException;

/**
 * HasListExport contains logic for imports
 */
trait HasListExport
{
    /**
     * checkUseListExportMode
     */
    protected function checkUseListExportMode()
    {
        if (!$useList = $this->getConfig('export[useList]')) {
            return false;
        }

        if (!$this->controller->isClassExtendedWith(\Backend\Behaviors\ListController::class)) {
            throw new ApplicationException(__("You must implement the controller behavior ListController with the export 'useList' option enabled."));
        }

        if (is_array($useList)) {
            $listDefinition = array_get($useList, 'definition');
        }
        else {
            $listDefinition = $useList;
        }

        return $this->exportFromList($listDefinition);
    }

    /**
     * exportFromList outputs the list results as a CSV export.
     * @param string $definition
     * @param array $options
     */
    public function exportFromList($definition = null, $options = [])

View on GitHub (pinned to b608633a7e)