Skip to content

[LTI] fix: allow deleting tools whose objects no longer exist - #12378

Merged
Saaweel merged 1 commit into
ILIAS-eLearning:release_12from
surlabs:ilias12_LTI_fix_tool_usages
Nov 5, 2026
Merged

Saaweel merged 1 commit into
ILIAS-eLearning:release_12from
surlabs:ilias12_LTI_fix_tool_usages

Conversation

@Saaweel

@Saaweel Saaweel commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

In Administration > LTI > ILIAS as LTI Platform (Consumer), deleting a tool fails with "At least one tool could not be deleted because it has usages (might be in trash)." although the tool has no usages: the column "Repository Usages" shows 0 and the tab "Usage" lists nothing.

ilLTITool::countUsages() counts every row of lti_consumer_settings that points to the tool, also rows of LTI objects that no longer exist in the system. The tab "Usage" and the usage columns only count objects with a reference, so both checks disagree and the tool can never be deleted.

Fix

  • countUsages() only counts LTI objects that have a reference, in the repository or in the trash, as the tab "Usage" does.
  • A tool used by an object in the repository or in the trash still cannot be deleted.

Testing

On a test installation with tools whose objects had already been removed from the system: the tools could not be deleted before the change, and they are deleted after it.

@Saaweel Saaweel added bugfix php Pull requests that update Php code labels Nov 5, 2026
@Saaweel Saaweel self-assigned this Nov 5, 2026
@Saaweel
Saaweel merged commit 64270e6 into ILIAS-eLearning:release_12 Nov 5, 2026
2 of 6 checks passed
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.

1 participant