? ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
11 Apr 2021

Pull Request for Issue # .

Summary of Changes

When data for a Repeatable field from Joomla 3 migrated to a SubField on Joomla 4, the value for media field type is stored in String, not in JSON format as expected, thus it throws some warnings when the field is being displayed (see #32611 (comment) )

This PR solves that error by overriding method onCustomFieldsPrepareField for Media field to make sure $field->value is an array (for Media field not belong to a Subfield, that's prepared on onCustomFieldsBeforePrepareField already)

Testing Instructions

This only affect Repetable field migrated to Subfield, so @HLeithner can take a look and if it solves the issue, he can get it merged. I don't want to waste time of tester by having to install Joomla 3.10.0, upgrade to Joomla 4, then test this small fix.

avatar joomdonation joomdonation - open - 11 Apr 2021
avatar joomdonation joomdonation - change - 11 Apr 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2021
Category Front End Plugins
avatar HLeithner
HLeithner - comment - 11 Apr 2021

Wouldn't it be better to convert it? Else we need this code till joomla 10.

avatar joomdonation
joomdonation - comment - 11 Apr 2021

I'm unsure. The onCustomFieldsPrepareField trigger is available for us to use, so I think we can use it to handle this case, and it is simpler than converting the data. We already do similar check/conversion for media field in onCustomFieldsBeforePrepareField, so It is not hurt to do the same on onCustomFieldsPrepareField

@laoneo Could you give some suggestions here?

If you both agree that we should do data conversion, I will try to do so.

avatar laoneo
laoneo - comment - 12 Apr 2021

@joomdonation looks fine for me...

avatar joomdonation
joomdonation - comment - 12 Apr 2021

Thanks @laoneo. @HLeithner Are you OK with this approach? If not, I will try to find sometime to find a way to convert data to expected format in migration script.

avatar laoneo
laoneo - comment - 12 Apr 2021

Migration script would be much better tbh...

avatar joomdonation
joomdonation - comment - 12 Apr 2021

OK. Thanks for the feedback. I will try to find sometime to do that with migration script, then.

avatar joomdonation joomdonation - close - 12 Apr 2021
avatar joomdonation joomdonation - change - 12 Apr 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-04-12 07:23:49
Closed_By joomdonation
Labels Added: ? ?

Add a Comment

Login with GitHub to post a comment