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 49 forks source link

PHP 5.6 syntax errors #482

Closed jonathanstegall closed 1 year ago

jonathanstegall commented 2 years ago

Describe the bug See this forum post.

The offending line of code is, at least:

// load mappings that match this criteria
// in this case, it's all mappings that correspond to the posted WordPress object.
$sf_mappings = $this->mappings->get_fieldmaps(
    null, // id field must be null for multiples.
    array_merge(
        $this->mappings->active_fieldmap_conditions,
        array(
            'wordpress_object' => $object_type,
        )
    ),
);

To Reproduce Steps to reproduce the behavior:

  1. Install PHP 5.6.
  2. Try to run the plugin

Additional context

That comma is incorrect, as it's essentially a list of parameters in a function call with a comma after the last one. I'm not positive that removing the comma would fix PHP 5.6 issue, but it's possible, and either way I really do think it was a mistake to put the comma in there.

jonathanstegall commented 2 years ago

Presumably there are more commas to hunt down. It would be nice if it were possible to run 5.6 through Laravel Valet, but this is no longer supported. I'm not entirely sure what to do to further test all of this without a viable localhost. Maybe a VirtualBox kind of setup.

jonathanstegall commented 1 year ago

In a future release, should instead just remove support for PHP versions below 7.4, as this is what wordpress.org now says.