Skip to content

Fix inventory per org intallation#1999

Merged
MightyMCoder merged 5 commits intomasterfrom
fix-inventory-per-org-intallation
Mar 27, 2026
Merged

Fix inventory per org intallation#1999
MightyMCoder merged 5 commits intomasterfrom
fix-inventory-per-org-intallation

Conversation

@MightyMCoder
Copy link
Copy Markdown
Member

@MightyMCoder MightyMCoder commented Mar 18, 2026

closes #1997 #1995

@MightyMCoder MightyMCoder added this to the v5.0.8 milestone Mar 18, 2026
@MightyMCoder MightyMCoder requested a review from Fasse March 18, 2026 19:21
@MightyMCoder MightyMCoder self-assigned this Mar 18, 2026
@Fasse
Copy link
Copy Markdown
Member

Fasse commented Mar 19, 2026

What's about existing installations? Are they correct because the first org_id will be 1 and that fits the ID of the field that should be updated?

@MightyMCoder
Copy link
Copy Markdown
Member Author

I missed that...
I will implement a update step to fix wrong entries when Admidio was newly installed with Admidio 5.0 and a new organization was added within Admidio 5.0.x..

…ganization id instead of the corresponding field id
@MightyMCoder
Copy link
Copy Markdown
Member Author

@Fasse: I have now implemented an additional update step to resolve incorrectly assigned selection options that occurred during new installations and when creating new organisations.

Comment on lines +262 to +264
(ifo_inf_id, ifo_value, ifo_system, ifo_sequence)
VALUES (?, ?, ?, ?)';
$this->db->queryPrepared($sql, array($statusFieldId, $statusOption['inf_name'], true, $statusOption['ifo_sequence']));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should set the ifo_system = true in the SQL Statement. Since all parameters are handled as Strings per default, PostgreSQL will not accept true as a parameter.

After that change you can merge this.

@Fasse
Copy link
Copy Markdown
Member

Fasse commented Mar 25, 2026

I add the Postgres compatiblity to this branch.

@MightyMCoder Can you merge this PR?

@MightyMCoder MightyMCoder merged commit dd7186e into master Mar 27, 2026
@MightyMCoder MightyMCoder deleted the fix-inventory-per-org-intallation branch March 27, 2026 09:38
Fasse pushed a commit that referenced this pull request Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong inventory field select options set when creating new organization

2 participants