Difference in JSON stored in Database for Repeatable Media Field (J3) vs. Subform Media Field (J4) #39867
Unanswered
justinherrin
asked this question in
General
Replies: 2 comments 5 replies
-
The repeatable fields should be converted automatically to subform fields when updating from 3.10 to 4.x with the Joomla Update Component, so why do you need to convert this manually? |
Beta Was this translation helpful? Give feedback.
0 replies
-
@richard67 I updated from J3.10.x to 4.x locally using the Joomla Update Component and the update/updater did nothing for my custom extension. I wouldn't expect it to touch my custom extension files at all. I would have been quite surprised if it did anything. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all. I have a custom component built for J3 that I am in the process of updating to J4 and I have run into some trouble with the JSON values that are stored in the database when using the old Repeatable Field -> Media Field in J3 vs. Subform Field -> Media Field in J4.
The JSON stored is rather different from Repeatable Field in J3 to Subform Field in J4 and I am hoping someone can assist me with updating my JSON values to be compatible with J4.
Example of JSON stored with Repeatable Field -> Media Field in J3:
{ "book_image": [ "images/books/cover.jpg", "images/books/inside.jpg", "images/books/back.jpg" ] }
Example of JSON stored with Subform Field -> Media Field in J4:
{ "book_images0": { "book_image":"images\/books\/cover.jpg#joomlaImage:\/\/local-images\/books\/cover.jpg?width=769&height=769" }, "book_images1": { "book_image":"images\/books\/inside.jpg#joomlaImage:\/\/local-images\/books\/inside.jpg?width=769&height=769" }, "book_images2": { "book_image":"images\/books\/back.jpg#joomlaImage:\/\/local-images\/books\/back.jpg?width=769&height=769" } }
I have hundreds of records in the custom component stored, so any assistance to automate the process would be greatly appreciated.
Thanks in advance!
P.S. - Sorry the JSON code examples appear on single line. In the post I have everything in a more readable manner (line breaks, tabbed over, etc.) 🤷♂️
Beta Was this translation helpful? Give feedback.
All reactions