[DOCU-2620] Basic PageListener example config is confusing Created: 07/Dec/22 Updated: 21/Dec/22 Resolved: 21/Dec/22 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Raphael Falvo | Assignee: | Alex Mansell |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Documentation page URL: | https://docs.magnolia-cms.com/product-docs/6.2/Modules/List-of-modules/Observation-module.html#_listener_configuration |
| Reporter Name: | Raphael Falvo |
| Email: | raphael.falvo@magnolia-cms.com |
| Description |
|
Basic PageListener example config is confusing. User tends to believe that using nodeType property in a simple Listener would help to filter nodes based on passed nodeType, but it actually doesn't work. Looking at the definition app using this config shows that the property is not mapped in PageListener example.
This property is mapped only in advanced listeners provided by the module like RestrictToNodeTypeEventListener or SpecifiedNodeTypeOnlyEventListener, but not in basic Listener class that would just implement EventListener interface. It seems that the description of the property tries to explain it a bit but it is still not 100% clear that this property doesn't work on any listener class.
|
| Comments |
| Comment by Jaroslav Simak [ 08/Dec/22 ] |
|
The nodeType is in the wrong place. It should be one level above, under the listener node. |
| Comment by Raphael Falvo [ 08/Dec/22 ] |
|
Just found an interesting link while having issues when trying to use the nodeType config at the right place: |
| Comment by Jaroslav Simak [ 08/Dec/22 ] |
|
Can you send me an export of your configuration? I will check the behavior. |
| Comment by Raphael Falvo [ 08/Dec/22 ] |
|
You can find config.yaml file in attachement jsimak To test it I upload an asset using Upload Zip archive option
You can find the context here : |
| Comment by Jaroslav Simak [ 08/Dec/22 ] |
|
Cool, thanks. I will check out your branch and see what's happening there. |
| Comment by Jaroslav Simak [ 09/Dec/22 ] |
|
I can confirm the behavior you described. I received events only when I created nodes under mgnl:page node type which I defined in the config. |
| Comment by Raphael Falvo [ 09/Dec/22 ] |
|
Thank you jsimak |