The problem:

Each mapping has a checkbox 'Batch records' that cannot be checked unless you have the salesforce_soap module enabled. However, all code related to this checkbox has to do with saving/restoring its value and availability as an option for the mapping. In other words, it doesn't actually change any functionality when you check that box.

This is, at the minimum, pretty confusing to the site builder.

Proposed solutions, ordered here from easiest to hardest

Option 1: Get rid of that checkbox.

This would be easy and wouldn't break any current functionality (since there is no current functionality implemented).

Option 2: Move the checkbox to the global settings page and make it do something

Making "Batch records" a global setting would basically replicate what is happening now -- because now you're getting records batched whether you want them or not the second you turn on "Salesforce Soap". The "$use_soap" flag in salesforce_push_cron() could then not only check that the module is enabled, but also that the checkbox is checked.

Option 3: Make the current checkbox act as expected

This is the most complicated solution, since it requires changing the code within the salesforce_push_cron() for loop to check for $use_soap() on a per-item basis. This would lead to a combination of some immediate synced items which would run first, then some batch-synced items which would run later. I suspect this would lead to unexpected conflicts based on when items are processed. This starts to get into the territory covered in https://www.drupal.org/node/2565863

-------------------------

Given the three solutions above, I'm leaning toward #2, and will push up an initial patch for that, but I expect there will be some additional comments or feedback on this one.

Comments

mariacha1 created an issue. See original summary.

mariacha1’s picture

Status: Active » Needs review
StatusFileSize
new5.3 KB

Here's a patch to do Option 2. I haven't updated the tests or the help text here -- both will need to be done for this to be RTBC, but as I said, I consider this a starting point only.

mariacha1’s picture

Here's an updated version of the patch that takes care of a couple issues:

-- The update hook clears the schema cache to avoid errors when the old field is gone
-- Update the text on the global checkbox to reference the Async option on the mapping.

mariacha1’s picture

aaronbauman’s picture

+1 for option number 2

ruscoe’s picture

Rerolled patch in #3 against the latest 7.x-3.x branch. There was just an update hook naming conflict.

gcb’s picture

Commited to dev. Thanks all!

  • gcb committed 3fd47da on 7.x-3.x authored by mariacha1
    Issue #2748575 by mariacha1, ruscoe: Batch Records checkbox doesn't do...
mariacha1’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.