Skip to content

TestQuestionPool 48016: Fix Global Units In New Questions - #12135

Closed
aaronbidzan wants to merge 1 commit into
ILIAS-eLearning:trunkfrom
aaronbidzan:ta/12/48016
Closed

aaronbidzan wants to merge 1 commit into
ILIAS-eLearning:trunkfrom
aaronbidzan:ta/12/48016

Conversation

@aaronbidzan

Copy link
Copy Markdown
Contributor

See: https://mantis.ilias.de/view.php?id=48016

When creating a new formula question, the unit picker exposed globally defined units because the unit repository was initialized with consumer id 0, which is the same sentinel used for admin-wide units. New questions now use consumer id -1 until the question is saved and setId() assigns the real id, matching the intended import-first workflow for local units.

/cc @thojou

See: https://mantis.ilias.de/view.php?id=48016

When creating a new formula question, the unit picker exposed globally
defined units because the unit repository was initialized with consumer
id 0, which is the same sentinel used for admin-wide units. New
questions now use consumer id -1 until the question is saved and
`setId()` assigns the real id, matching the intended import-first
workflow for local units.
@dsstrassner dsstrassner added bugfix php Pull requests that update Php code labels Oct 6, 2026
@dsstrassner

Copy link
Copy Markdown
Contributor

@kergomard gehe ich recht in der Annahme, dass hier @thojou das Review alleine übernehmen muss, weil deine Abwesenheit ansteht?

@kergomard kergomard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you very much for the PR @aaronbidzan ! Please do not set -1 as the default value, but null (I know, this is more work, but it is work well invested). -1 as value for none in a language with null-values is a bad convention from where I stand.

This for me looks like it needs to be picked back to all maintained versions, right? In this case the PR MUST be against the lowest version that needs it, otherwise the risk of fuck-ups increases even further, if I'm wrong and this is only trunk, then it is perfect.

@thojou : Please proceed from here, so that we can get this done.

Thanks again and best,
@kergomard

@aaronbidzan

Copy link
Copy Markdown
Contributor Author

I have created a separate PR now pointing to release_10 as the base since the problem is also reflected there, whilst I originally found it in the trunk. This PR will be closed.

#12217

Kind regards,
@aaronbidzan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants