Skip to content

Commit

Permalink
Fixed issue with php 7.1, and 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapjansma committed Mar 25, 2021
1 parent 384a006 commit 1329962
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion integration-civicrm-leaflet.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
Plugin Name: Integration between Leaflet Map and CiviCRM
Description: Integrates data from the CiviCRM api into a Leaflet Map. You can use this plugin with Connector to CiviCRM with CiviMcRestFace (https://wordpress.org/plugins/connector-civicrm-mcrestface/)
Version: 1.0.4
Version: 1.0.5
Author: Jaap Jansma
License: AGPL3
License URI: https://www.gnu.org/licenses/agpl-3.0.html
Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: leaflet, CiviCRM, map, leaflet map, api, connector, rest
Requires at least: 5.2
Tested up to: 5.6
Requires PHP: 7.2
Stable tag: 1.0.4
Stable tag: 1.0.5
License: AGPL-3.0

Provides an integration between CiviCRM api and the [leaflet map](https://wordpress.org/plugins/leaflet-map/). Meaning you can create maps from CiviCRM Data.
Expand Down Expand Up @@ -38,6 +38,7 @@ For more documentation see: [README.md](https://github.com/CiviMRF/integration-c

== Changelog ==

1.0.5: Fixed issue with php 7.1, and 7.2
1.0.4: Fixed issue with CiviMcRestFace.
1.0.3: Fixed issue with jQuery.
1.0.2: Fixed issue with jQuery.
Expand Down
10 changes: 8 additions & 2 deletions shortcodes/class.civicrm-api-shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class Leaflet_CiviCRM_Api_Shortcode extends Leaflet_Shortcode {
*
*/
protected function getHTML($atts = '', $content = NULL) {
// need to get the called class to extend above variables
$class = self::getClass();

if ($atts) {
extract($atts);
}
Expand Down Expand Up @@ -133,12 +136,15 @@ function featureCallback(feature, layer) {

function apiParamCallback() {
var filters = {
<?php foreach($filters as $filterName => $filter) {
<?php
$i = 0;
foreach($filters as $filterName => $filter) {
$suffix = ",";
if (array_key_last($filters) == $filterName) {
if ($i === count($filters)) {
$suffix = "";
}
echo '"'.esc_js($filter['name']).'": '.esc_js($filter['js_value_function']).esc_js($suffix);
$i++;
} ?>
};

Expand Down

0 comments on commit 1329962

Please sign in to comment.