Bug in storing settings for CiviContribute component
The two settings of the CiviContribute component
- Always post to Accounts Receivable?
- Enable Deferred Revenue?
do not have any effect on how financial transactions are created, although they apparently should.
In general, settings are stored in the table civicrm_setting, one setting per row. There is one exception: All settings for the CiviContribute component are stored combined within one single row.
The storing of the settings for the two checkboxes mentioned above deviates from this principle: Two distinct rows are generated for the settings. These rows are also accessed to display their respective values within the settings form (i.e. once checked, the checkboxes remain checked at a later display of the settings page).
HOWEVER, when reading from the settings table within the program code, just the combined row gets accessed for all CiviComponent related settings (e.g. for 'deferred_revenue_enabled'). (See function checkContributeSettings($name = NULL, $checkInvoicing = FALSE) in file Contribution.php).
Therefore the settings get de facto ignored, when they should control how transactions get generated based on their values.
I tried to manually change the combined data row in the database, which actually made the settings work as expected. See also this StackExchange entry .