Skip to content

Conversation

rdeutz
Copy link
Contributor

@rdeutz rdeutz commented Aug 31, 2025

Pull Request for Issue #45584 .

Summary of Changes

At some moment in the past we changed the events for the Table* classes from onAction to onTableAction. It was obviously missed to make this change for the delete method of the nested table class. This results in the situation that history entires for categories and tags are not deleted.

a) This fix is a bug fix but also kind of b/c break.
We need to document the b/c break. I would expect that It is unlikely that the event is used.

b) Further more we are not cleaning up the existing entires in the history table for not longer existing tags and categories.
Maybe something we can do in a helath checker or pre-update check, but not as part of this PR.

Testing Instructions

  • Create one tag
  • Check database table __history and see item_id entry com_tags.tag.id
  • Trash and delete the tag

Actual result BEFORE applying this Pull Request

The database table __history entry for com_tags.tag.id is still existing

Expected result AFTER applying this Pull Request

The database table __history entry for com_tags.tag.id is not existing

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@rdeutz rdeutz added bug b/c break This item changes the behavior in an incompatible why. HEADS UP labels Aug 31, 2025
@rdeutz rdeutz added this to the Joomla! 5.3.4 milestone Aug 31, 2025
@exlemor
Copy link

exlemor commented Sep 1, 2025

I have tested this item ✅ successfully on 401b41a

Hi there, I was able to test it successfully! Thanks @rdeutz


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46020.

@muhme
Copy link
Contributor

muhme commented Sep 5, 2025

I have tested this item ✅ successfully on 401b41a

Tested with JBT, before the PR with 5.3-dev branch

  • Seen the error before with com_tags.tag and com_content.category

Installed the PR with graft full package

  • Enabled 'Debug System' and 'Log Almost Everything'
  • Created a tag with one history entry and another tag with three history entries, all history entries are deleted together with the tags
  • Created a content category with one history entry and another content category with three history entries, all history entries are deleted together with the content categories
  • Disabled versioning
    • Component > Tags > Options > Enable Versions > No
      • Created tag, trashed and deleted
    • Content > Categories > Options > Editing Layout > Enable Versions > No
      • Created content category, trashed and deleted
  • Checked administrator/logs/* and PHP log
    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46020.

@alikon
Copy link
Contributor

alikon commented Sep 5, 2025

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46020.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 5, 2025
@bembelimen
Copy link
Contributor

We should call the old event, too and deprecate it. Otherwise we make all plugins, which are using the wrong methods broken.

@bembelimen bembelimen added the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Sep 6, 2025
@rdeutz
Copy link
Contributor Author

rdeutz commented Sep 7, 2025

@bembelimen done, called old event and depreciated it as requested

@rdeutz rdeutz removed the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Sep 7, 2025
@muhme muhme added the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Sep 8, 2025
@muhme
Copy link
Contributor

muhme commented Sep 8, 2025

Reset to “Pending” as there have been code changes


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46020.

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Sep 8, 2025
@muhme muhme removed the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Sep 8, 2025
@rdeutz
Copy link
Contributor Author

rdeutz commented Sep 8, 2025

Reset to “Pending” as there have been code changes

It is only bringing back the old event call, would be a surprise if that breaks something.

@muhme
Copy link
Contributor

muhme commented Sep 8, 2025

Reset to “Pending” as there have been code changes
It is only bringing back the old event call, would be a surprise if that breaks something.

Sorry, I don't have this overview. Does anyone else want to set RTC again or should I just retest?

@rdeutz
Copy link
Contributor Author

rdeutz commented Sep 9, 2025

@muhme retest would be fine but I don't think we need two tests.

@muhme
Copy link
Contributor

muhme commented Sep 9, 2025

I have tested this item ✅ successfully on c293027

After branch update, successfully tested again as outlined in #46020 (comment)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46020.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46020.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 9, 2025
@richard67
Copy link
Member

@rdeutz Now as the old event is called, too, can the "b/c break" label be removed?

@brianteeman
Copy link
Contributor

It says deprecated without replacement and then goes on to say use ....

Surely that is the replacement

@richard67
Copy link
Member

richard67 commented Sep 9, 2025

It says deprecated without replacement and then goes on to say use ....

Surely that is the replacement

@brianteeman Not sure if it is really a replacement as they are not the same events, and the calls to the old events will be removed without replacement.

@rdeutz What do you think? Maybe just remove the , use onTable...Delete event at the end of the deprecation comments?

@laoneo
Copy link
Member

laoneo commented Sep 9, 2025

This has to go into 5.4 as we don't do deprecations in patch releases.

@rdeutz
Copy link
Contributor Author

rdeutz commented Sep 10, 2025

It is a bugfix so it is 5.3.

For the message I guess you can argue in many ways, I made what Richard suggested.

@richard67 richard67 changed the base branch from 5.3-dev to 5.4-dev September 10, 2025 13:56
@richard67 richard67 changed the title [5.3] Change the table event name from onBeforeDelete to on TableBeforeDelete [5.4] Change the table event name from onBeforeDelete to on TableBeforeDelete Sep 10, 2025
@richard67 richard67 added bug and removed bug PR-5.3-dev b/c break This item changes the behavior in an incompatible why. HEADS UP labels Sep 10, 2025
@richard67
Copy link
Member

Rebased to 5.4-dev. RTC is still valid as it was a clean rebase.

@muhme
Copy link
Contributor

muhme commented Sep 11, 2025

✅ Final retest before merge as in #46020 (comment)

@muhme muhme merged commit 338bef3 into joomla:5.4-dev Sep 11, 2025
40 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Sep 11, 2025
@muhme muhme added this to the Joomla! 5.4.0 milestone Sep 11, 2025
@muhme
Copy link
Contributor

muhme commented Sep 11, 2025

Thank you @RobertDeutz for your contribution. Thank you @richard67, @laoneo, @bembelimen and @brianteeman for support. Thank you @exlemor for testing.

@rdeutz rdeutz deleted the table-event branch September 12, 2025 15:31
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.

10 participants