Skip to content

[5.4] Schemaorg system plugin onContentAfterDelete issue #44020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 23, 2025

Conversation

Denitz
Copy link
Contributor

@Denitz Denitz commented Sep 5, 2024

Summary of Changes

Schemaorg system plugin onContentAfterDelete event tries do delete the schema even if context is not supported, and we have a warning if an item doesn't have id attribute.

Testing Instructions

Delete any item of custom component which doesn't implement SchemaorgServiceInterface or doesn't have id attribute.

Actual result BEFORE applying this Pull Request

See a similar warning in error log:

PHP Warning:  Undefined property: Xxx\\Component\\Xxx\\Administrator\\Table\\Xxx::$id in /var/www/public_html/plugins/system/schemaorg/src/Extension/Schemaorg.php on line 545

Expected result AFTER applying this Pull Request

No warning, only items which support schemaorg and with ID column are deleted.

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

@richard67 richard67 added the bug label Sep 5, 2024
@richard67 richard67 changed the base branch from 5.1-dev to 5.2-dev September 22, 2024 10:15
@HLeithner HLeithner changed the title Schemaorg system plugin onContentAfterDelete issue [5.2] Schemaorg system plugin onContentAfterDelete issue Nov 15, 2024
@HLeithner HLeithner changed the base branch from 5.2-dev to 5.3-dev April 15, 2025 16:15
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.3-dev.

@HLeithner HLeithner changed the title [5.2] Schemaorg system plugin onContentAfterDelete issue [5.3] Schemaorg system plugin onContentAfterDelete issue Apr 15, 2025
@Denitz Denitz changed the base branch from 5.3-dev to 5.4-dev August 21, 2025 11:17
@Denitz Denitz changed the title [5.3] Schemaorg system plugin onContentAfterDelete issue [5.4] Schemaorg system plugin onContentAfterDelete issue Aug 21, 2025
@richard67
Copy link
Member

Delete any item of custom component which doesn't implement SchemaorgServiceInterface or doesn't have id attribute.

@Denitz Do you know a publicly available example for such an extension? If so, please add that info to your testing instructions. It could make it much easier to find testers for this PR, e.g. at the Pizza, Bugs & Fun (PBF) event tomorrow.

@Denitz
Copy link
Contributor Author

Denitz commented Aug 22, 2025

@richard67 Unfortuntely, I don't remember now what was the origin for this error. It could be Hikashop: the #__hikashop_product table of products has product_id primary key. There is a free starter version.

@richard67
Copy link
Member

@Denitz Maybe you know a small extension which could be modified e.g. by changing the context? Or could a core extension like e.g. com_contact be modified in that way for testing?

@Fedik
Copy link
Member

Fedik commented Aug 22, 2025

I have tested this item ✅ successfully on 6ed047e

On review, calling deleteSchemaOrg() with empty ID does not make sense


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

@richard67
Copy link
Member

I have tested this item ✅ successfully on 6ed047e

Tested by code review. The deleteSchemaOrg method is not called when there is no item id, and regarding the check if the context is supported the behaviour is not changed, only code is optimised to avoid multiple calls for the same thing.


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

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 22, 2025
@richard67 richard67 added this to the Joomla! 5.4.0 milestone Aug 22, 2025
@muhme muhme merged commit 8b66249 into joomla:5.4-dev Aug 23, 2025
40 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 23, 2025
@muhme
Copy link
Contributor

muhme commented Aug 23, 2025

Thank you @Denitz for your contribution. Thank you @Fedik and @richard67 for testing.

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.

7 participants