{"id":9063072,"date":"2017-04-24T20:20:40","date_gmt":"2017-04-24T20:20:40","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/illegal-string-offset-warning-5\/"},"modified":"2017-04-24T20:20:40","modified_gmt":"2017-04-24T20:20:40","slug":"illegal-string-offset-warning-5","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/illegal-string-offset-warning-5\/","title":{"rendered":"Illegal string offset warning"},"content":{"rendered":"<p>I&#8217;m getting a few <code>Illegal string offset<\/code> warnings when I open the &#8220;GatherContent&#8221; page in WordPress.  Nothing else is displayed, so I can&#8217;t actually do anything with the plugin.  I&#8217;m getting this error immediately after activating the plugin and clicking on &#8220;GatherContent&#8221; in the admin menu.  I haven&#8217;t configured the plugin at all.  If I disable warnings or patch the plugin (as explained below), the page loads as it should.  These are the full text of the warnings:<\/p>\n<pre><code>\nWarning: Illegal string offset &#039;fed5f7cb3f57119fe54948b89fd7d345&#039; in \/var\/www\/html\/wp-content\/plugins\/gathercontent-import\/includes\/classes\/views\/view.php on line 68\n\nWarning: Illegal string offset &#039;fed5f7cb3f57119fe54948b89fd7d345&#039; in \/var\/www\/html\/wp-content\/plugins\/gathercontent-import\/includes\/classes\/views\/view.php on line 75\n&lt;\nWarning: Illegal string offset &#039;fed5f7cb3f57119fe54948b89fd7d345&#039; in \/var\/www\/html\/wp-content\/plugins\/gathercontent-import\/includes\/classes\/views\/view.php on line 78\n<\/code><\/pre>\n<p>The problem is that the <code>View::views<\/code> variable is not being initialized correctly on line 28.  It&#8217;s being initialized as a string, not as an array.  So when it is later accessed as an array, PHP throws a warning.  Making this change to line 28 fixes the problem:<\/p>\n<p><code>protected static $views = [];<\/code><\/p>\n<p>I&#8217;d rather not turn off warnings to fix this, since I&#8217;m working in a development environment.  So I&#8217;ll probably just patch the plugin and hope it gets fixed in the next update.  Thanks!  <\/p>\n","protected":false},"template":"","class_list":["post-9063072","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9063072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/9063072\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=9063072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}