-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toggling _isAvailable can result in inappropriate locking #164
Comments
Chris: Just to follow up on this. The solution I've used is to reset the _isLocked status as follows in applyLocks prior to determining _isLocked: Adapt.course.getAllDescendantModels(true).forEach(siteModel => {
if (siteModel.get('_isTrickled')) {
siteModel.setOnChildren('_isLocked', false);
}
}); I'm not sure if this is ideal, but I've had success with it where _isAvailable is dynamically set on articles. |
Can confirm I have also seen this as a result of a role selector changing the availability of the first locked model in a page hierarchy. The const setDescendantLocks = ((model, id) => {
model.getAllDescendantModels().forEach(descendant => {
const descendantId = descendant.get('_id');
modelsById[descendantId] = descendant;
locks[descendantId] = locks[id];
});
});
if (!locks[id]) setDescendantLocks(siteModel, id); |
Subject of the issue/enhancement/features
A custom plugin determines which articles are available based on some criteria. Each of these articles are configured to use trickle. The trickle plugin will set the
_isLocked
property on the articles and blocks as expected. At some later time all but one of the mentioned articles are set to_isAvailable:false
. The article that is set to_isAvailable:true
may still retain_isLocked:true
. Rendering therefore stops at the article and the first block is not rendered as it should be.Executing
applyLocks
does not correct the_isLocked
property. Therefore, it is proposed that prior toapplyLocks
determining which models are locked, the_isLocked
property is set tofalse
on all models.Your environment
Steps to reproduce
See above
Expected behaviour
See above
Actual behaviour
See above
The text was updated successfully, but these errors were encountered: