After updating to the latest 7.x-2.x-dev release from 7.x-2.13, I get these PHP warnings:

Warning: in_array() expects parameter 2 to be array, string given in sharethis_node_view() (line 86 of /sandbox/d7/sites/all/modules/contrib/sharethis/sharethis.module).
Warning: in_array() expects parameter 2 to be array, string given in sharethis_node_view() (line 109 of /sandbox/d7/sites/all/modules/contrib/sharethis/sharethis.module).

The new settings logic from #2050875: ShareThis in a block AND on node(s) expects an array instead of a string. Deploying this update to ~800 sites with this module enabled in a base feature, we can't just go save the settings form, so here is a patch that fixes this with an update hook using the logic added from #2050875: ShareThis in a block AND on node(s). Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vinmassaro created an issue. See original summary.

vinmassaro’s picture

Status: Active » Needs review
FileSize
1005 bytes
navneet0693’s picture

Status: Needs review » Needs work
+++ b/sharethis.install
@@ -86,3 +86,14 @@ function sharethis_update_7002() {
+    $location_places = array($location_places);

So earlier, it was variable_get('sharethis_location', 'content') in this patch: https://www.drupal.org/node/2050875#comment-11846268.
The changes in the patch made it like this:

'content' => 'content',

but code here will update it to:

'0' => 'content'

navneet0693’s picture

navneet0693’s picture

FileSize
957 bytes

Oh, forgot to add interdiff. Here it is.

navneet0693’s picture

Status: Needs work » Needs review
vinmassaro’s picture

Status: Needs review » Reviewed & tested by the community

Patch works well for me, thanks for updating.

Chris Charlton’s picture

Patched tested. It helped.

Note: Sites with Domain Access module enabled need to make sure they run the script for all domains, or we update the patch here to detect that module and account for it in the DB update. The easy non-code fix for sites with Domain Access (once this patch is in) is to choose "All Domains" when re-saving the settings from the ShareThis admin screen.

purushotam.rai’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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