@@ -3804,13 +3804,19 @@ private function processTokenStack($tokens, $cellID = null, Cell $pCell = null)
38043804 if ($ this ->branchPruningEnabled && isset ($ tokenData ['onlyIf ' ])) {
38053805 $ onlyIfStoreKey = $ tokenData ['onlyIf ' ];
38063806 $ storeValue = $ branchStore [$ onlyIfStoreKey ] ?? null ;
3807+ $ storeValueAsBool = ($ storeValue === null ) ?
3808+ true : (bool ) Functions::flattenSingleValue ($ storeValue );
38073809 if (is_array ($ storeValue )) {
38083810 $ wrappedItem = end ($ storeValue );
38093811 $ storeValue = end ($ wrappedItem );
38103812 }
38113813
3812- if (isset ($ storeValue ) && (($ storeValue !== true )
3813- || ($ storeValue === 'Pruned branch ' ))
3814+ if (isset ($ storeValue )
3815+ && (
3816+ !$ storeValueAsBool
3817+ || ($ storeValue === '#N/A ' )
3818+ || ($ storeValue === 'Pruned branch ' )
3819+ )
38143820 ) {
38153821 // If branching value is not true, we don't need to compute
38163822 if (!isset ($ fakedForBranchPruning ['onlyIf- ' . $ onlyIfStoreKey ])) {
@@ -3833,12 +3839,17 @@ private function processTokenStack($tokens, $cellID = null, Cell $pCell = null)
38333839 if ($ this ->branchPruningEnabled && isset ($ tokenData ['onlyIfNot ' ])) {
38343840 $ onlyIfNotStoreKey = $ tokenData ['onlyIfNot ' ];
38353841 $ storeValue = $ branchStore [$ onlyIfNotStoreKey ] ?? null ;
3842+ $ storeValueAsBool = ($ storeValue === null ) ?
3843+ true : (bool ) Functions::flattenSingleValue ($ storeValue );
38363844 if (is_array ($ storeValue )) {
38373845 $ wrappedItem = end ($ storeValue );
38383846 $ storeValue = end ($ wrappedItem );
38393847 }
3840- if (isset ($ storeValue ) && ($ storeValue
3841- || ($ storeValue === 'Pruned branch ' ))
3848+ if (isset ($ storeValue )
3849+ && (
3850+ $ storeValueAsBool
3851+ || ($ storeValue === '#N/A ' )
3852+ || ($ storeValue === 'Pruned branch ' ))
38423853 ) {
38433854 // If branching value is true, we don't need to compute
38443855 if (!isset ($ fakedForBranchPruning ['onlyIfNot- ' . $ onlyIfNotStoreKey ])) {
0 commit comments