MATLAB: Does Simulink 7.4 (R2009b) throw an error if a library block modifies itself in its mask editor callback function

simulink

I have a library block which is a masked subsystem of a group of blocks. In the dialog parameter callback function accessible by 'mask editor' pane of this block, I modify some parameters of blocks inside it using 'set_param' command. For example, in the attached library "Testlib", I modify the parameter 'SaturateOnIntegerOverflow' of product block inside using dialog callback function using the code below:
flag = get_param(gcb,'SaturateOnIntegerOverflow');
products = find_system(gcb,'FollowLinks','on','LookUnderMasks','all','Name', 'Product1');
for idx = 1 : length(products)
set_param(products{idx},'SaturateOnIntegerOverflow',flag);
end
Now, if I use this block in a model, I get the following error whenever I attempt modify the setting.
Error due to multiple causes --> Attempting to override parameters of 'Tesrmodel/lib/Product1' which is inside a library link.
--> Error evaluating 'MaskCallback' callback of SubSystem block (mask) 'Testmodel/lib/Product1'. Attempting to override parameters of
'Testmodel/lib/Product1' which is inside a library link.

Best Answer

This is intended behavior. We have a separate checkbox in the mask editor pane of the block named 'Allow library blocks to modify it's contents' that can be set to 'true' to indicate that we want the library blocks to be able to modify itself.