tbar0970 / jethro-pmm

Jethro Pastoral Ministry Manager
GNU General Public License v3.0
35 stars 25 forks source link

Error when you run document merge on SOME persons shown in a report #1009

Closed tbar0970 closed 6 months ago

tbar0970 commented 6 months ago

View a report Tick SOME of the persons but not all Mail merge a document

Undefined offset: 7 
Line 254 of /home/jethro/code/2.34.1/app/calls/call_document_merge.class.php
USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

It seems like the code is making the assumption that all persons in the report will be part of the merge

tim-pearce commented 6 months ago

My version, which has that same code does not get that error.

tim-pearce commented 6 months ago

I don't have a running copy of version 2.34.1. I can only assume that line 248,249 is returning data for all persons. In that case replace $merge_data[$val] += $data; with if (isset($merge_data[$val])) { $merge_data[$val] += $data; }