Skip to content

Remove categories from the KB, articles can now directly have children - #24922

Open
AdrienClairembault wants to merge 17 commits into
glpi-project:mainfrom
AdrienClairembault:feature/kb-categories-to-articles
Open

Remove categories from the KB, articles can now directly have children#24922
AdrienClairembault wants to merge 17 commits into
glpi-project:mainfrom
AdrienClairembault:feature/kb-categories-to-articles

Conversation

@AdrienClairembault

@AdrienClairembault AdrienClairembault commented Jul 22, 2026

Copy link
Copy Markdown
Member

Categories no longer exists, now any article can have children/parent articles.
This bring the KB in line with modern tools like outline or notion which use a similar system.

Note: I've reverted #24848 during a rebase as it was merged unexpectedly late and was conflicting with most of the changes.
Rather than deal with conflicts, I've re-added it cleanly as a separate commit at the end.

@AdrienClairembault
AdrienClairembault force-pushed the feature/kb-categories-to-articles branch 6 times, most recently from ee7e251 to 2206110 Compare July 22, 2026 14:32
class: KnowbaseItemCategory::class,
field: 'knowbaseitemcategories_id',
full_schema: 'KBCategory'
'knowbase_article' => self::getDropdownTypeSchema(

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.

Renaming properties and linking to a new schema that doesn't have a superset of the old properties, is an API version contract violation.

'x-field' => 'answer',
],
'categories' => [
'parents' => [

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.

Renaming properties and linking to a new schema that doesn't have a superset of the old properties, is an API version contract violation.

],
],
],
'KBCategory' => [

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.

Removing schemas is an API version contract violation.

return ResourceAccessor::deleteBySchema($this->getKnownSchema('KBArticle', $this->getAPIVersion($request)), $request->getAttributes(), $request->getParameters());
}

#[Route(path: '/Category', methods: ['POST'])]

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.

Removing endpoints is an API version contract violation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The itemtype was dropped from GLPI. Not sure how we can avoid API violation when something is no longer available.

As the main API maintainer, what would you suggest here?

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.

I'm working on a solution for that today. It may involve some underlying changes to the API but at least from the user POV, I think I can keep it working without breaking changes.

In short, I am going to try to keep the KBCategory schema name but have its properties mapped to the new KB articles, and then add a deprecation for it. For changed/renamed properties, I'm going to try doing the same and utilizing the "x-version-introduced/deprecated/removed" properties.

@f2cmb f2cmb changed the title Remove categories from the KB, articles can now directly have children KB : Remove categories from the KB, articles can now directly have children Jul 24, 2026
@f2cmb f2cmb linked an issue Jul 24, 2026 that may be closed by this pull request
@AdrienClairembault
AdrienClairembault force-pushed the feature/kb-categories-to-articles branch from 2206110 to 8d3afb6 Compare July 24, 2026 08:48
@AdrienClairembault AdrienClairembault changed the title KB : Remove categories from the KB, articles can now directly have children Remove categories from the KB, articles can now directly have children Jul 24, 2026
@AdrienClairembault
AdrienClairembault marked this pull request as ready for review July 24, 2026 09:23
@AdrienClairembault

Copy link
Copy Markdown
Member Author

@cedric-anne This one is high priority to finish the KB feature so don't wait for me to come back (I'm away for 2 weeks). @f2cmb will take over if any changes are requested.

@cedric-anne cedric-anne added this to the 12.0.0 milestone Jul 27, 2026
@cedric-anne
cedric-anne force-pushed the feature/kb-categories-to-articles branch from 8d3afb6 to 76e798a Compare July 27, 2026 08:29

@cedric-anne cedric-anne left a comment

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.

Except for the API schema changes, it seems OK.

@cconard96

Copy link
Copy Markdown
Member

Except for the API schema changes, it seems OK.

Still working on getting HLAPI v3 ready. Seems some issues were unknowingly suppressed instead of just one known issue.

GLPI had no visibility criteria on categories so each
article had his own rights.

Now that the categories will become articles, they have
access to the right management criteria.

To keep GLPI in line with modern practices, this mean that
if you have access to a given article, you should also be
able to view any children of this article (= you can see an
article if you match its visibility criteria or the ones from
one of its parents).
AdrienClairembault and others added 6 commits July 27, 2026 15:27
This commit was reverted at the top to avoid conflicts, I've remade
it from scratch at the end to make sure it take into account the new
changes.
@f2cmb
f2cmb force-pushed the feature/kb-categories-to-articles branch from 9aca8b6 to 03de1f4 Compare July 27, 2026 13:28
@f2cmb f2cmb mentioned this pull request Jul 31, 2026
4 tasks
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.

Transform categories into articles

4 participants