jethro-pmm icon indicating copy to clipboard operation
jethro-pmm copied to clipboard

'Undefined offset: 1' error when editing people

Open jefft opened this issue 3 years ago • 3 comments

Since January (v2.29 and 2.30.0) I've occasionally been seeing these stacktraces in the logs:

Line 550 of /srv/www/jethro/2.30.0/include/general.php

USER:       1
REFERER:    https://jethro/?view=_edit_person&personid=4632
USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36

REQUEST:
Array
(
    [view] => _edit_person
    [personid] => 4632
    [edit_object_submitted] => 1
    [first_name] => Bronwyn
    [last_name] => Redacted
    [gender] => female
    [age_bracketid] => 1
    [congregationid] => 1
    [status] => 1
    [email] =>
    [mobile_tel] =>
    [work_tel] =>
    [remarks] => Looking for a church
    [custom_1_d] => Array
        (
            [0] =>
        )

    [custom_1_m] => Array
        (
            [0] =>
        )

    [custom_1_y] => Array
        (
            [0] =>
        )

    [custom_1_note] => Array
        (
            [0] =>
        )

or:

Line 550 of /srv/www/jethro/2.30.0/include/general.php

USER:       1
REFERER:    https://jethro/?view=_add_person_to_family&familyid=886
USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36

REQUEST:
Array
(
    [view] => _add_person_to_family
    [familyid] => 886
    [new_person_submitted] => 1
    [first_name] => Will
    [last_name] => Redacted
    [gender] => male
    [age_bracketid] => 2
    [congregationid] => 1
    [status] => 3
    [email] =>
    [mobile_tel] =>
    [work_tel] =>
    [remarks] =>
    [photo] =>
    [custom_1_d] => Array
        (
            [0] =>
        )

    [custom_1_m] => Array
        (
            [0] =>
        )

    [custom_1_y] => Array
        (
            [0] =>
        )

(Full stacktrace)

general.php line 550 is something to do with date custom fields:

https://github.com/tbar0970/jethro-pmm/blob/c23be947b52e47694749ecdf658a90c0d4d30bad/include/general.php#L550

I'm unable to replicate this, editing the affected user or just messing around incompletely filling in date fields. Nobody has complained but users seldom do :)

(Sorry for slightly lazy investigating - I figure filing something is better than nothing)

jefft avatar May 31 '21 00:05 jefft

I wonder if there is some whitespace in the custom field note

tbar0970 avatar Jul 07 '21 10:07 tbar0970

I wonder if there is some whitespace in the custom field note

...which makes it look like a second value is being supplied for the field, but it's actually not...

tbar0970 avatar Jun 29 '22 09:06 tbar0970

No luck replicating

tbar0970 avatar Jun 27 '23 11:06 tbar0970