This is a fix for 0.8.0, 0.8.1 and (as of now) the current BurnBright version:
Using the FlatTaxModifier, I'm getting the following error when it is the second of two modifiers. The same problem probably also happens with other modifiers that iterate through all the modifiers. (It needs to do that to calculate tax on shipping etc)
Debug::fatalHandler(256,Uncaught Exception: Object->__call(): the method 'total' does not exist on 'DataObjectSet' in ...\sapphire\core\Object.php,724,Array) exceptionHandler(exception 'Exception' with message 'Object->__call(): the method 'total' does not exist on 'DataObjectSet'' in ...sapphire\core\Object.php:724 Stack trace: #0 ...\model\Order.php(609): Object->__call('Total', Array) #1 ...\model\Order.php(609): DataObjectSet->Total() #2 ...\modifiers\FlatTaxModifier.php(104): Order->ModifiersSubTotal('FlatTaxModifier') #3 ...\modifiers\FlatTaxModifier.php(93): FlatTaxModifier->TaxableAmount() ...etc...
The cause is in Order.php, in the createModifiers function.
To fix it, change from...
return $write ? $this->modifiersFromDatabase() : new DataObjectSet($modifiers);
return $write ? $this->modifiersFromDatabase() : $modifiers;
...because $modifiers is already a DataObjectSet, so the old code creates a nested DataObjectSet. When the result is returned, and the caller tries to interate through the modifiers, it finds the nested DataObjectSet instead of a Modifier, which is why the error message says 'total' does not exist on 'DataObjectSet'.
I haven't tested older versions, but in version 8.0, ShoppingCart::get_modifiers() changed to return a dataset instead of an array, so looks like it affects all versions since then.