Install joomla 3 (3.10.11). In contact component there are the contact custom fields :
Create a repeatable custom field in contact component :
During migration there is a 500 error :
When connecting to admin, the fields for contact component have disapeared from the menu :
No error during migration to joomla 4.
After migrating to J4, the contact custom fields and fields group should be in the menu like in this fresh J4 instalation :
When connecting to admin, the fields for contact component have disapeared from the menu :
The test was made on a laragon local environement with php 7.4.30
According to this discussion : #36944
the issue is related to the repeatable field. The field migration can be done by going from J3 to J4.0.3 then to 4.1 then to 4.2
Labels |
Added:
No Code Attached Yet
|
Title |
|
Nope, my PR has nothing to do with it.
The Repeatable field no longer exists in Joomla 4. It has been replaced by the Subform field. However, neither the definition nor the data stored by the two field types is compatible with each other. During the migration the repeatable fields will just disappear.
There was a further issue (probably caused by a third party plugin) during the migration as the screenshot shared. This means that Joomla never finished its migration which explains why parts of it are broken.
I would recommend removing the migrated site's files and database data (important!), restore it from a backup, disable all third party system plugins and run the migration again. The only observable artefact will be that the repeatable field is no longer working, as expected, this is something which was happening since the early 4.0 betas long before my PR.
@nikosdion the test I made was on a fresh J 3.10.11 installation with no 3rd party plugins installed.
I can understand that the repeatable fields and thier data are removed during migration but the contact custom fields should be avaiblable after migration.
@web-tiki I am not the person you should be talking to about the custom fields or data migration on Joomla upgrade. I have absolutely no authority on the project. I hold no leadership position, no title and have zero power in decision making and the repository itself.
I am just here because Richard was wondering if my (unrelated, as it turns out) contribution had something to do. It doesn't; my contribution was improving on subform fields. With my contribution you can say "these fields will only appear inside custom fields, don't show them elsewhere". I actually only started using custom fields around the time Joomla 3.9 was around and a lot more with Joomla 4, hence my unrelated contribution. I simply didn't have the time to redo my sites before. I've never used a Repeatable field, not even on a test site, because by the time I started using custom fields I knew that the Repeatable field type is on the chopping block for Joomla 4.
The problem you have is definitely caused by PHP complaining that a class already exists. The way the Joomla 3 and 4 core code is you can't normally get that problem.
However, it is possible that you have OPcache enabled on your server and configured in a way which will cause that problem. You said that you're using Laragon which DOES use OPcache and DOES configure it in a way that makes sense for deploying Laravel applications whose code DOES NOT change, not for deploying Joomla sites whose code changes during a request (that's what the update does). I have not used it myself so I don't know if you can disable OPcache or how. If you can, do that.
If you can't disable OPcache I would recommend using a self-built local server. It's not that hard and you get to understand how everything fits together much better. If you're on Windows you can easily use IIS or adapt my macOS tutorial for setting up Apache and MySQL — I use both on my secondary machine which runs on Windows. I never had problems with Joomla upgrades and I've been testing the upgrade from Joomla 3 to 4 since the first Joomla 4 betas. I had to; I knew the day would come when my clients would do that and ask me for help restoring their backups for I am the author of a rather well-known backup extension for Joomla
As for repeatable fields, I have no idea what will happen on the updated site. As I said, I have not used them. I infer that the data would still be in the database but since there is no repeatable
field in the fields
group anymore you will be thrown back to a text field interface which displays the raw JSON in the database.
If you ask me what is my personal opinion for this, I would tell you that Joomla should have handled this differently. One option would be offering a repeatable field plugin which actually sets up a subform field with the only difference that it can reshape the data before it's read from and written to the database (repeatable and subform use different formats for the stored JSON data). Another option would be converting all repeatable fields to subform and add some login in the subform fields plugin to understand the legacy data format of repeatable fields when the data is being read. Either way would make the transition smoother. I can't tell you why this didn't happen. Nobody asked me for my input and I quit the Joomla 4 Working Group back in late 2015 when the direction it was taking was not agreeing with my vision for Joomla 4 (eventually, around 2017, it came back on track but by that time my wife was pregnant and as a result I had no time to rejoin the Joomla 4 Working Group).
@nikosdion Thank you for all this information.
I will do more tests and try with another development environment without OPcache.
I followed the changes with the repeatbable field from J3 to J4 as I use it extensively. I didn't have this issue on other sites as don't usually use them with the contact component.
Also I use your "rather well-known backup extension" almost everyday. Thank you :)
I have made another test on the same server as last comment.
The issue doesn't occur when there is no repeatable field for contact component before upgrade.
The upgrade does not show any error and the contact custom fields work after upgrade.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-11-18 04:17:52 |
Closed_By | ⇒ | joomdonation |
Closing because this is an duplicate issue. @web-tiki If you still have this problem, see #37177 (comment) for a reason and a workaround while waiting for official solution.
Edit: I posted the solution here so that you don't have to find it from the long posted text.
For the time being, if anyone has this issue, while waiting for official solution, you can get the file restore.zip , unzip it, upload the received file to administrator/components/com_joomlaupdate to your Joomla 3 installation and update will work well.
There is a pull request now which solves this issue: #39245 . Please test it and report back your test results in the issue tracker using the blue "Test this" button. When the pull request has 2 good tests, it will be marked to be merged and then can be part of the next release. Thanks in advance.
The only change which I've found for fields between 4.0.3 and 4.0.4 is this PR: #35547 . I have no idea if it's related. But maybe it needs some change in this function https://github.com/joomla/joomla-cms/blob/4.2-dev/administrator/components/com_admin/script.php#L221 where the fields migration takes place? @nikosdion Do you have an idea if the here could be related to PR #35547 ?