Plugin uses StandardController

Hi,

I’m trying to create a Neos Plugin. I followed the instructions of the manual and created another controller (MyController).
I created all the files mentioned in the manual in the plugin directory (Packages/Application/My.Plugin).
The plugin works as i can insert the created plugin node from the backend into my site. But my problem is that it uses the StandardController instead of my created MyController.

Packages/Application/My.Plugin/Ressources/Private/Fusion/Root.fusion

prototype(My.Plugin:Plugin) < prototype(Neos.Neos:Plugin)
prototype(My.Plugin:Plugin) {
      package = 'My.Plugin'
      controller = 'MyController' #uses StandardController nevertheless
      action = 'index'
}

Packages/Application/My.Plugin/Configuration/NodeTypes.yaml

'My.Plugin:Plugin':
  superTypes:
    'Neos.Neos:Plugin': TRUE
  ui:
    label: 'MyPlugin'
    group: 'plugins'

Packages/Application/My.Plugin/Configuration/Settings.yaml

Neos:
  Neos:
    Fusion:
      autoInclude:
        'My.Plugin': TRUE

What am I missing/doing wrong?

Kind regards

Hi @kurztipp,
my first thoughts:

  1. Are you in Development or Production context?
  2. Have you tried with the command ./flow flow:package:rescan ?

Bests,
N

Hi,

  1. I’m in Development context. What difference does this make?
  2. I tried the command. It had no effect.

If I copy the fusion code

prototype(My.Plugin:Plugin) < prototype(Neos.Neos:Plugin)
prototype(My.Plugin:Plugin) {
      package = 'My.Plugin'
      controller = 'MyController' #uses StandardController nevertheless
      action = 'index'
}

into my Site’s fusion directory (e.g. /Packages/Sites/My.Site/Resources/Private/Fusion/Plugin.Fusion) the plugin uses MyController as expected.
Is this necessary? I cant imagine that this is the way to go, since its a plugin and I think all files are meant to be in the plugin’s package directory?

You might be missing the config setting to automatically include Fusion in packages that are not Site packages. Add the following setting to your Plugin packages Settings.yaml.

Neos:
  Neos:
    fusion:
      autoInclude:
        My.Plugin: true

Also, if this is missing from the docs, time to add it :wink:

Hi,

I did this (see my initial posting) but it didn’t work. I changed “Fusion” to “fusion”. Maybe that was the fault. It seems to work now . If YAML is case-insensitive and the uppercase Fusion can’t cause the error: Are there any other cli commands that will make neos read the settings.yaml once again? Could this be necessary?

Regards

Ah, sorry - it seems I read over that part. :wink: But yes, that was probably the error. Config/YAML is case-sensitive. You can make Flow re-read all config by removing caches (./flow neos.flow:cache:flush --force) or removing the Data/Temporary folder. Also, you can have a look at the compiled config via ./flow configuration:show --type Settings for debugging purposes.

The manual seems to be incorrect since it states to use Fusion: instead of the lower-case fusion. I tried to contribute a fix for the manual page but i’m not sure if it worked out.