Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with config "archived" person statuses #1120

Open
jefft opened this issue Jan 7, 2025 · 6 comments
Open

Issues with config "archived" person statuses #1120

jefft opened this issue Jan 7, 2025 · 6 comments
Labels

Comments

@jefft
Copy link
Contributor

jefft commented Jan 7, 2025

In Jethro 2.35.1 and earlier there was a hardcoded archived person status, and all was well.

In Jethro 2.36.0, person statuses became editable, and the one considered "archived" is configurable:

image

I'd like to suggest that there should be one and only one 'archived' status:

image

Because:

  1. I can't imagine a scenario where more than one 'archived' status is needed. We already have an 'in use' flag to indicate unused'ness.
  2. The code assumes just one. When archiving a family, each person is automatically archived. If there is more than one 'archived' status, the code arbitrarily picks the first:

$this->setValue('status', reset($stats=Person_Status::getArchivedIDs)); // we use the top-ranked 'is_archived' status.

(This code is also buggy, giving the error PHP message: Only variables should be passed by reference)

That is going to give incorrect results if e.g. someone "archives" an existing status (thinking it is equivalent to "in use"):

image

  1. What happens if someone removes the archive bit from 'Archived'?

image

The above 'archive family' code is going to break.

So IMO having one and only one 'archived' status is the best solution.

@tbar0970
Copy link
Owner

tbar0970 commented Jan 7, 2025

The rationale for having more than one is to be able to distinguish "deceased" from "moved out of area" or "joined another church" etc.

But the point you raise about the auto-archiving is worthy of thought...

@tbar0970
Copy link
Owner

tbar0970 commented Jan 7, 2025

And perhaps the config interface could use some tweaking to make it clearer what "is archived" means.

tbar0970 added a commit that referenced this issue Feb 4, 2025
…s. Make the labelling clearer and explain that the first 'archived' status will be used when auto-archiving persons in an archived family.
@tbar0970
Copy link
Owner

tbar0970 commented Feb 4, 2025

jethro-pmm/db_objects/person.class.php

Line 1110 in 91f6f61

$this->setValue('status', reset($stats=Person_Status::getArchivedIDs)); // we use the top-ranked 'is_archived' status.
(This code is also buggy, giving the error PHP message: Only variables should be passed by reference)

I can't replicate this error on PHP Version 8.3.9 ...?

@tbar0970 tbar0970 added the bug label Feb 4, 2025
@tbar0970 tbar0970 changed the title There should be just one 'Archived' person status Issues with config "archived" person statuses Feb 4, 2025
@jefft
Copy link
Contributor Author

jefft commented Feb 5, 2025

Commit d4d16f5 prevents the 'Archived Person?' flag from being removed from everyone, which is good!

However it doesn't stop people deleting the 'Archived' status altogether, which is the situation we've encountered:

Image

@jefft
Copy link
Contributor Author

jefft commented Feb 5, 2025

$this->setValue('status', reset($stats=Person_Status::getArchivedIDs)); // we use the top-ranked 'is_archived' status.
(This code is also buggy, giving the error PHP message: Only variables should be passed by reference)

I can't replicate this error on PHP Version 8.3.9 ...?

Try deleting a person, then 'Archive and Cleanse' (e.g. on https://easyjethro.com.au/demo/). I get a stacktrace:

Fatal Error (Exception)
Undefined class constant 'getArchivedIDs'

Show Details
Line 1110 of File /home/eaea6621/public_html/demo/db_objects/person.class.php
	Array
(
    [0] => Array
        (
            [file] => /home/eaea6621/public_html/demo/views/view_0_delete_person.class.php
            [line] => 60
            [function] => archiveAndClean
            [class] => Person
            [type] => ->
            [args] => Array
                (
                )

        )

    [1] => Array
        (
            [file] => /home/eaea6621/public_html/demo/include/system_controller.class.php
            [line] => 128
            [function] => processView
            [class] => View__Delete_Person
            [type] => ->
            [args] => Array
                (
                )

        )

    [2] => Array
        (
            [file] => /home/eaea6621/public_html/demo/index.php
            [line] => 67
            [function] => run
            [class] => System_Controller
            [type] => ->
            [args] => Array
                (
                )

        )

)		

@tbar0970
Copy link
Owner

tbar0970 commented Feb 5, 2025

Try deleting a person, then 'Archive and Cleanse' (e.g. on https://easyjethro.com.au/demo/). I get a stacktrace:
Fatal Error (Exception)
Undefined class constant 'getArchivedIDs'

THanks, will fix. Different error message to what you mentioned originally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants