Skip to content

[6.0] Change the media manager from CMSObject to stdClass #44945

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 5 commits into from
Mar 17, 2025

Conversation

laoneo
Copy link
Member

@laoneo laoneo commented Feb 19, 2025

Summary of Changes

Change the object in the media manager for the events from object to stdClass.

Testing Instructions

  • Upload a file
  • Upload the same file again and replace it
  • Create a folder
  • Delete the new folder
  • Delete the new file

Actual result BEFORE applying this Pull Request

All works.

Expected result AFTER applying this Pull Request

All works.

Link to documentations

Please select:

@Tejashrimajage
Copy link

I have tested this item 🔴 unsuccessfully on 51644be

Before apply patch If and uplaod same image it replaces original one. But after applying patch getting error
MediaHelper::getContentTypeLink(): Argument #3 ($mediaObject) must be of type Joomla\CMS\Object\CMSObject, stdClass given, called in /var/www/ttpl-rt-215-php81.local/public/joomlatest/administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php on line 254


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

@laoneo
Copy link
Member Author

laoneo commented Feb 22, 2025

Are you on Joomla 6? Because the file /administrator/components/com_media/helpers/media.php should accept \stdClass and not CMSObject

@exlemor
Copy link

exlemor commented Feb 22, 2025

I have tested this item ✅ successfully on 06c6e04

I have successfully tested this PR :) (was on 6.0.0-alpha1-dev+pr.44735 and it worked great)


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

@QuyTon
Copy link
Contributor

QuyTon commented Feb 23, 2025

Warning after deleting a file:

PHP Warning: Undefined property: stdClass::$id in \plugins\system\schemaorg\src\Extension\Schemaorg.php on line 545

@laoneo
Copy link
Member Author

laoneo commented Feb 23, 2025

See #44989

@QuyTon
Copy link
Contributor

QuyTon commented Feb 26, 2025

I have tested this item ✅ successfully on 06c6e04


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

@QuyTon
Copy link
Contributor

QuyTon commented Feb 26, 2025

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 26, 2025
@HLeithner HLeithner added the b/c break This item changes the behavior in an incompatible why. HEADS UP label Feb 27, 2025
@HLeithner
Copy link
Member

This is a hard b/c break, in the discussion yesterday we came up with a solution use the compact plugin.

@laoneo
Copy link
Member Author

laoneo commented Feb 27, 2025

Discused this today in the maintainer chat and there is no reliable and easy to maintain solution to this issue. So this change is absolute ok.

@Bodge-IT Bodge-IT added this to the Joomla! 6.0.0 milestone Mar 17, 2025
@Bodge-IT Bodge-IT merged commit b248ec8 into joomla:6.0-dev Mar 17, 2025
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 17, 2025
@Bodge-IT
Copy link
Contributor

Thanks @laoneo and testers

@laoneo laoneo deleted the cmsobject/media branch March 17, 2025 20:21
@laoneo
Copy link
Member Author

laoneo commented Mar 18, 2025

Thanks and don't forget the docu

@HLeithner
Copy link
Member

Discused this today in the maintainer chat and there is no reliable and easy to maintain solution to this issue. So this change is absolute ok.

here is your solution #45216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b/c break This item changes the behavior in an incompatible why. HEADS UP PR-6.0-dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants