View Single Post
Old 01-17-2021, 02:22 PM   #269
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,529
Karma: 8075744
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
The condition chaley suggested is per action. It is currently not going to work. I think the solution to this would be to validate only actions that are going to run under the current conditions. So if you set a condition on an action using chaley's new function, the action will only be validated if the condition is true. I hope the explanation makes sense.
Validating only actions that will be run makes sense.

However, unless I am misunderstanding I don't think the problem is as large as you indicate, at least for template actions. Looking at check_template() I see that the template is run to see if it produces an error. Assume the template looks something like this
Code:
program:
    if field_exists('#somefield') then
        do_something();
        do_something_else()
    fi
This template won't produce an error if #somefield doesn't exist so it would validate. Of course it might not do what the action requires, which is a different problem.
chaley is offline   Reply With Quote