Skip to content

Custom field values for categories are not deleted when a category is deleted #38379

@domcotec

Description

@domcotec

Steps to reproduce the issue

  1. Create a new custom field for categories (Navigate to Content > Fields, select 'Category' in the filter dropdown at the top of the page and click '+New' to create a new custom field and save it.)
  2. Create a new category (Content > Categories > New)
  3. In the category switch to the 'Fields' tab and add some data to the custom field you just created. Save.
    (Now in the database in table #__fields_values a new row is created with the catID, fieldID and custom field value.)
  4. Now change the publication 'Status' to 'Trash' and then go to the trash and delete the category completely.
    (Here is the potential bug: In the database table #__fields_values the row for this catID and fieldID should have been deleted, but it remains in the database.)

Expected result

Deleting a category should also delete the mapped custom field values. (This actually works for articles, but not for categories)

Actual result

The row for the deleted category ID and field ID with the field values remains in the database (unused forever).

System information (as much as possible)

Joomla! 4.1.5
PHP 7.4.30

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions