Skip to content

Commit

Permalink
Support publicationStatus for sites #3011
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Oct 21, 2023
1 parent 9f69b98 commit 04fccbf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion grails-app/assets/javascripts/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,10 @@ function orEmptyArray(v) {
self.context = context;
self.config = config;

// This context is created for use by the expression evaluator. It contains the data model item itself
// as well as the parent data model item and the output model.
var dataContext = context.parent;

/**
* Returns the value of the specified metadata property (e.g. validate, constraints etc)
* @param property the name of the proprety to get.
Expand Down Expand Up @@ -828,7 +832,7 @@ function orEmptyArray(v) {

self.evaluateBehaviour = function (type, defaultValue) {
var rule = _.find(metadata.behaviour, function (rule) {
return rule.type === type && ecodata.forms.expressionEvaluator.evaluateBoolean(rule.condition, context);
return rule.type === type && ecodata.forms.expressionEvaluator.evaluateBoolean(rule.condition, dataContext);
});

return rule && rule.value || defaultValue;
Expand Down

0 comments on commit 04fccbf

Please sign in to comment.