cancel
Showing results for 
Search instead for 
Did you mean: 

FormFilter not being called on action

leonardo_celati
Champ in-the-making
Champ in-the-making
I have implemented a Form Filter and register it within my module-context.xml

The filter is correctly invoked for each forms in share interface, however it is not fired when I need it, which is when I invoke a custom action in doclib and a form is displayed.

This is the form definition in share-config-custom.xml of my share module, nothing special, I have removed the fields (text and date field type) for clarity:

<config evaluator="string-compare" condition="myCustomShareAction">
      <forms>
         <form>
            <field-visibility>
               <show id="…." />
            </field-visibility>
            <appearance>
               <field></field>
                                        …….
                                </appearance>
                       </form>
               </forms>
</config>


This is the action

         <action id="${project.artifactId}_MyCustomShareAction"
            type="javascript" label="message.title" icon="invoice-modify-aspect">
            <param name="action">myCustomShareAction</param>
            <param name="function">onActionFormDialog</param>
            <param name="itemKind">action</param>
            <param name="itemId">myCustomShareAction</param>
            <param name="mode">edit</param>
            <param name="destination">{node.nodeRef}</param>
            <param name="successMessage">…</param>
            <param name="failureMessage">…</param>
            <evaluator>isMyCustomShareActionVisible</evaluator>
         </action>


Then the filter in module-context.xml of my AMP repo project:


   <bean id="actionShareFormFilterNode" class="…ActionShareFormFilter" parent="baseFormFilter">
         <property name="filterRegistry" ref="nodeFilterRegistry" />
   </bean>
   
   <bean id="actionShareFormFilterType" class="…ActionShareFormFilter" parent="baseFormFilter">
               <property name="filterRegistry" ref="typeFilterRegistry" />
   </bean>



I am not reporting the ActionShareFormFilter because it has nothing special in it just a log statement.
Everything is working, but to reassume, when I click the action in doclib the form is correctly displayed, but the filter is never invoked. If instead I click "modify content", or just viewing a datailst I can see the filter being invoked.

I have removed few lines of code for clarity, so there's probably some syntax error in the lines above.
1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator
Hello,

unfortunately, form filters on actions are not supported by Alfresco. I had created a <a href="https://issues.alfresco.com/jira/browse/ALF-15535">JIRA / support issue</a> for this quite a long time ago and Alfresco simply closed it last year as "won't fix".
Note: You can't use the nodeFilterRegistry / typeFilterRegistry for Actions - they are only there for node creation, view and edit. The ALF-15535 would have added a filter registry for Actions.

Fortunately, the patch is pretty simple, so you could include this yourself. We have been maintaining this in our internal Alfresco patch library for a few years now.

Regards
Axel