MinnPost / object-sync-for-salesforce

WordPress plugin that maps and syncs data between Salesforce objects and WordPress objects.
https://wordpress.org/plugins/object-sync-for-salesforce/
GNU General Public License v2.0
93 stars 48 forks source link

Fatal error when trying to update: Pull from Salesforce > Run Schedule Every (wp-admin) #507

Closed eli-antebi closed 1 year ago

eli-antebi commented 1 year ago

Environment: WP 6.1.1, ACF 5.12.2, PHP 8.1.6

To Reproduce: Settings > Salesforce > Scheduling > Change value in [Run Schedule Every] to "5" and A[Time Unit] to "Minutes"

Error:

Fatal error: Uncaught TypeError: DateTime::construct(): Argument #1 ($datetime) must be of type string, array given in D:_\wp-content\plugins\object-sync-for-salesforce\vendor\woocommerce\action-scheduler\functions.php:336 Stack trace: #0 D:_____\wp-content\plugins\object-sync-for-salesforce\vendor\woocommerce\action-scheduler\functions.php(336): DateTime->construct(Array, Object(DateTimeZone)) #1 D:__\wp-content\plugins\object-sync-for-salesforce\vendor\woocommerce\action-scheduler\classes\ActionScheduler_ActionFactory.php(114): as_get_datetimeobject(Array) #2 D:_____\wp-content\plugins\object-sync-for-salesforce\vendor\woocommerce\action-scheduler\classes\ActionScheduler_ActionFactory.php(149): ActionScheduler_ActionFactory->single_unique('object_sync_for...', false, Array, 1669279306, 'salesforcepull...') #3 D:_____\wp-content\plugins\object-sync-for-salesforce\vendor\woocommerce\action-scheduler\functions.php(59): ActionScheduler_ActionFactory->recurring_unique('object_sync_for...', Array, 1669279306, 0, 'salesforcepull...', false) #4 D:_____\wp-content\plugins\object-sync-for-salesforce\classes\class-object-sync-sf-queue.php(215): as_schedule_recurring_action(1669279306, 0, 'object_sync_for...', Array, 'salesforcepull...') #5 D:_____\wp-content\plugins\object-sync-for-salesforce\classes\class-object-sync-sf-admin.php(446): Object_Sync_Sf_Queue->schedule_recurring(1669279306, 0, 'object_sync_for...', Array, 'salesforcepull...') #6 D:_____\wp-content\plugins\object-sync-for-salesforce\classes\class-object-sync-sf-admin.php(399): Object_Sync_Sf_Admin->set_action_schedule('salesforce_pull', 'salesforcepull...') #7 D:_____\wp-includes\class-wp-hook.php(308): Object_Sync_Sf_Admin->initial_action_schedule('5', '0', 'object_syncfor...') #8 D:_____\wp-includes\plugin.php(205): WP_Hook->applyfilters('5', Array) #9 D:_____\wp-includes\option.php(463): apply_filters('pre_update_opti...', '5', '0', 'object_sync_for...') #10 D:\\wp-admin\options.php(322): update_option('object_sync_for...', '5') #11 {main} thrown in D:\\wp-content\plugins\object-sync-for-salesforce\vendor\woocommerce\action-scheduler\functions.php on line 336

jonathanstegall commented 1 year ago

Duplicate of #504.

jonathanstegall commented 1 year ago

To be clear, you can try the patch at https://github.com/woocommerce/action-scheduler/pull/883 (and possibly encourage them to merge it!)