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

Ensure at least one Archived person status is present #1156

Open
jefft opened this issue Feb 5, 2025 · 2 comments
Open

Ensure at least one Archived person status is present #1156

jefft opened this issue Feb 5, 2025 · 2 comments

Comments

@jefft
Copy link
Contributor

jefft commented Feb 5, 2025

In Jethro 2.36.0 the 'archived' status went from being an internal hardcoded thing to a normal status, but with an 'Is Archived' flag:

Image

But what happens if someone deletes the 'Archived' status?

Image

The answer is: everything breaks, since various bits of Jethro assume it is there:

Image

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND  pgm.groupid = 19
                                        ORDER BY pgms.`rank`, person.last_name, person.f...' at line 10
Line 171 of /home/jethro/code/2.36.0/app/include/jethrodb.php

USER:       1
REFERER:    https://jethro/?view=groups__list_all
USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15

REQUEST_ID: Z6Kvp3ymjn980YvlM3CZ1AAAgA4

REQUEST:
Array
(
    [view] => groups
    [groupid] => 19


)


BACKTRACE:
Array
(
    [0] => Array
        (
            [file] => /home/jethro/code/2.36.0/app/include/jethrodb.php
            [line] => 171
            [function] => execute
            [class] => PDOStatement
            [type] => ->
        )

    [1] => Array
        (
            [file] => /home/jethro/code/2.36.0/app/include/db_object.class.php
            [line] => 1190
            [function] => queryAll
            [class] => JethroDB
            [type] => ->
        )

    [2] => Array
        (
            [file] => /home/jethro/code/2.36.0/app/db_objects/person_group.class.php
            [line] => 177
            [function] => _getInstancesData
            [class] => db_object
            [type] => ->
        )

    [3] => Array
        (
            [file] => /home/jethro/code/2.36.0/app/views/view_5_groups.class.php
            [line] => 142
            [function] => getMembers
            [class] => Person_Group
            [type] => ->
        )

    [4] => Array
        (
            [file] => /home/jethro/code/2.36.0/app/include/system_controller.class.php
            [line] => 193
            [function] => printView
            [class] => View_Groups
            [type] => ->
        )

    [5] => Array
        (
            [file] => /home/jethro/code/2.36.0/app/templates/main.template.php
            [line] => 117
            [function] => printBody
            [class] => System_Controller
            [type] => ->
        )

    [6] => Array
        (
            [file] => /home/jethro/code/2.36.0/app/include/system_controller.class.php
            [line] => 130
            [args] => Array
                (
                    [0] => /home/jethro/code/2.36.0/app/templates/main.template.php
                )

            [function] => require
        )

    [7] => Array
        (
            [file] => /home/jethro/code/2.36.0/app/index.php
            [line] => 67
            [function] => run
            [class] => System_Controller
            [type] => ->
        )

)

We should ensure there is at least one 'Is Archived' contact.

Related: #1120

@tbar0970
Copy link
Owner

tbar0970 commented Feb 5, 2025

Did you see my commit last night on #1120?

@jefft
Copy link
Contributor Author

jefft commented Feb 5, 2025

Did you see my commit last night on #1120?

Ah no - thanks, that partly fixes it. I've commented further on #1120.

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

No branches or pull requests

2 participants