Sorry, not a coder just trying to figure out an issue on a WP site.
Using 3rd party integrations from CF7 plugin to pull forms into a Salesforce instance, making some new forms up and suddenly stopped being able to edit the integration entries. Save function at bottom of page is no longer there replaced by a text box I've not seen before
3rd party integration list ends with this
which lead me to the plugin.ui php file with code
<?php
//only print the 'add another' button for the last one
$numPairs = count($entity['mapping']);
// make sure we have at least one
if( $numPairs == 0 ) {
$entity['mapping'] = array(array(
'val'=>'',
self::PARAM_LBL => '',
self::PARAM_SRC => '',
self::PARAM_3RD => ''
));
}
$pairNum = 0; //always increments correctly?
foreach($entity['mapping'] as $k => $pair)
?>
The error apparently appearing in the 3rd line here ($numPairs = ....) , left the rest of the expression for context. Just in case its relevant, running a rather deprecated v8.0.30 of php
As mentioned not a coder, first time using overflow, basically 100% uninformed, so i'm pretty much stumped from the word go and want expert advice before i try anything. Any and all solutions welcomed.
$numPairs = count($entity['mapping'] ?? []);- if$entity['mapping']does not exist, then an empty array will be used as argument forcountinstead. Whether the rest of it will then still work as intended, we can not tell you though, you'd have to test it.