Just tried to upgrade from v4.4.10 to Mautic 5 from the command line. The update says it’s successful.
However, when I log into Mautic, I cannot do anything with the forms anymore. Can’t publish/unpublish, or even create new forms.
I’m using PHP 8.0 / 10.6.16-MariaDB / All folder perms are correct.
Has anyone run into this?
Error log (these are only 2 entries):
[2024-01-09 16:42:20] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: “An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘t0.mapped_object’ in ‘field list’” at /var/www/ma.lexgabrees.com/htdocs/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 67 {“exception”:“[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 1054): An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘t0.mapped_object’ in ‘field list’ at /var/www/ma.lexgabrees.com/htdocs/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:67, Doctrine\DBAL\Driver\PDO\Exception(code: 1054): SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘t0.mapped_object’ in ‘field list’ at /var/www/ma.lexgabrees.com/htdocs/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘t0.mapped_object’ in ‘field list’ at /var/www/ma.lexgabrees.com/htdocs/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:121)”} {“hostname”:“lexgabrees”,“pid”:110339}
[2024-01-09 16:42:20] mautic.CRITICAL: Exception thrown when handling an exception (InvalidArgumentException: The HTTP status code “1054” is not valid. at /var/www/ma.lexgabrees.com/htdocs/vendor/symfony/http-foundation/Response.php line 470) {“exception”:“[object] (InvalidArgumentException(code: 0): The HTTP status code "1054" is not valid. at /var/www/ma.lexgabrees.com/htdocs/vendor/symfony/http-foundation/Response.php:470)”} {“hostname”:“lexgabrees”,“pid”:110339}
Hey there,
Thanks for updating so early, please can you clarify:
Have you cleared your cache?
Have you rebuilt your assets? (bin/console m:a:g)
I’ll flag it up for the team.
Hey Ruth,
Yes … did the following:
cleared cache
tried different PHP versions from 7.4 and up
Also, there was a plugin update issue regarding recaptcha. This dissappeared after uninstalling the plugin and clearing cache.
Did not rebuild assets, cause I never had to, but will give that a try later.
It looks like a a DB thing, cause I also can’t create new forms.
This is weird. I can see that the pull request adding this new column had a migration in it:
mautic:5.x
← volha-pivavarchyk:form-object-refactoring
opened 10:38AM - 01 Feb 23 UTC
<!-- ## Which branch should I use for my PR?
Assuming that:
a = current ma… jor release
b = current minor release
c = future major release
* a.x for any features and enhancements (e.g. 5.x)
* a.b for any bug fixes (e.g. 4.4, 5.1)
* c.x for any features, enhancements or bug fixes with backward compatibility breaking changes (e.g. 5.x) -->
| Q | A
| -------------------------------------- | ---
| Bug fix? (use the a.b branch) | [ ]
| New feature/enhancement? (use the a.x branch) | [ ]
| Deprecations? | [ ]
| BC breaks? (use the c.x branch) | [ ]
| Automated tests included? | [ ]
| Related user documentation PR URL | mautic/mautic-documentation#...
| Related developer documentation PR URL | mautic/developer-documentation#...
| Issue(s) addressed | Fixes #...
<!--
Additionally (see https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#work-on-your-pull-request):
- Always add tests and ensure they pass.
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against the "4.x" branch.
-->
#### Description:
<!--
Please write a short README for your feature/bugfix. This will help people understand your PR and what it aims to do. If you are fixing a bug and if there is no linked issue already, please provide steps to reproduce the issue here.
-->
This PR replaces [PR #11234](https://github.com/mautic/mautic/pull/11234): rebased and errors fixes
#### Steps to test this PR:
<!--
This part is really important. If you want your PR to be merged, take the time to write very clear, annotated and step by step test instructions. Do not assume any previous knowledge - testers may not be developers.
-->
1. Open [mautic/mautic on Gitpod](https://gitpod.io/#https://github.com/mautic/mautic) or pull down for testing locally (see docs on testing PRs [here](https://contribute.mautic.org/contributing-to-mautic/tester)) - as you need to do some things before applying the PR.
1. Before you checkout this PR:
2. Create a form with at least 4 fields. One mapped to the contact email field, one mapped to the company field under the contact opt group, one mapped to the primary company city field. The fourth field should not be mapped to any field.
3. Check out this PR - in Gitpod on the left hand side, look for the Github icon, then find this PR and right click to checkout the PR:
![screenshot-mautic-mautic-oq31hzs9992 ws-eu85 gitpod io-2023 02 04-15_36_18](https://user-images.githubusercontent.com/2930593/216773288-7d0610a4-f7b8-45c9-a2fb-4dffdc7232d2.png)
5. Run the migration using the terminal tab.
Run `ddev exec bin/console doctrine:migrations:execute --up 20200415135706`. Note: you can roll back your changes with `ddev exec bin/console doctrine:migrations:execute --down 20200415135706` if needed.
6. Open PHPMyAdmin under the Ports tab on Gitpod, look for the port 8036. Open it in a tab.
7. Open the database named 'db' and go to the `form_fields` table and check that the last 2 columns are `mapped_object` and `mapped_field`. The field that was mapped to the contact email field should have `mapped_object = 'lead'` and `mapped_field = 'email'`. The one that was mapped to the company field under the contact opt group should have `mapped_object = 'lead'` and `mapped_field = 'company'`. The one that was mapped to the primary company city field should have `mapped_object = 'company'` and `mapped_field = 'companycity'`. The form field that was not mapped at all should have null values there.
8. When you map one field then it should be removed from mapping of other fields. Example: Map contact email field to a form field. Create another field. The contact email field is not in the mapping list.
9. Test submissions of different field types.
10. Test conditional fields
11. Test progressive profiling (behaviours)
#### List deprecations along with the new alternative:
1. `form_fields.lead_field` column is deprecated. Use `mapped_object` and `mapped_field` instead.
2. `Mautic\FormBundle\Entity\Field::getLeadField()` and `setLeadField()`. Use getters and setters on `mappedObject` and `mappedField` properties instead.
3. `Mautic\FormBundle\Event\Service\FieldValueTransformer::isIsTransformed()` is deprecated as not used.
<!--
If you have any deprecations, list them here along with the new alternative.
If you have any backwards compatibility breaks, list them here.
-->
<a href="https://gitpod.io/#https://github.com/mautic/mautic/pull/11905"><img src="https://gitpod.io/button/open-in-gitpod.svg"/></a>
But I cannot find it in M5. I’ll keep digging.
I found the problem. Caused by my migration cleaning:
mautic:5.x
← escopecz:remove-m4-migrations
opened 10:48AM - 07 Jun 23 UTC
<!-- ## Which branch should I use for my PR?
Assuming that:
a = current ma… jor release
b = current minor release
c = future major release
* a.x for any features and enhancements (e.g. 5.x)
* a.b for any bug fixes (e.g. 4.4, 5.1)
* c.x for any features, enhancements or bug fixes with backward compatibility breaking changes (e.g. 5.x) -->
| Q | A
| -------------------------------------- | ---
| Bug fix? (use the a.b branch) | [ ]
| New feature/enhancement? (use the a.x branch) | [ ]
| Deprecations? | [ ]
| BC breaks? (use the c.x branch) | [ ]
| Automated tests included? | [ ]
| Related user documentation PR URL | mautic/mautic-documentation#...
| Related developer documentation PR URL | mautic/developer-documentation#...
| Issue(s) addressed | Fixes #...
<!--
Additionally (see https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#work-on-your-pull-request):
- Always add tests and ensure they pass.
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against the "4.x" branch.
-->
#### Description:
[The migrations created in Mautic 4](https://github.com/mautic/mautic/tree/4.4/app/migrations) are not necessary anymore. The old instances have run them and the new instances do not need them as the schema is generated from fresh entities.
We did the same thing form Mautic 4.0.0 and there were no issues AFAIK.
#### Steps to test this PR:
<!--
This part is really important. If you want your PR to be merged, take the time to write very clear, annotated and step by step test instructions. Do not assume any previous knowledge - testers may not be developers.
-->
1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs [here](https://contribute.mautic.org/contributing-to-mautic/tester))
2. I don't think this can be tested. Review is sufficient.
<!--
If you have any deprecations, list them here along with the new alternative.
If you have any backwards compatibility breaks, list them here.
-->
I’ll create a fix for Mautic 5.0.1. As a quick fix you can copy the content of this file:
mautic:5.x
← volha-pivavarchyk:form-object-refactoring
opened 10:38AM - 01 Feb 23 UTC
<!-- ## Which branch should I use for my PR?
Assuming that:
a = current ma… jor release
b = current minor release
c = future major release
* a.x for any features and enhancements (e.g. 5.x)
* a.b for any bug fixes (e.g. 4.4, 5.1)
* c.x for any features, enhancements or bug fixes with backward compatibility breaking changes (e.g. 5.x) -->
| Q | A
| -------------------------------------- | ---
| Bug fix? (use the a.b branch) | [ ]
| New feature/enhancement? (use the a.x branch) | [ ]
| Deprecations? | [ ]
| BC breaks? (use the c.x branch) | [ ]
| Automated tests included? | [ ]
| Related user documentation PR URL | mautic/mautic-documentation#...
| Related developer documentation PR URL | mautic/developer-documentation#...
| Issue(s) addressed | Fixes #...
<!--
Additionally (see https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#work-on-your-pull-request):
- Always add tests and ensure they pass.
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against the "4.x" branch.
-->
#### Description:
<!--
Please write a short README for your feature/bugfix. This will help people understand your PR and what it aims to do. If you are fixing a bug and if there is no linked issue already, please provide steps to reproduce the issue here.
-->
This PR replaces [PR #11234](https://github.com/mautic/mautic/pull/11234): rebased and errors fixes
#### Steps to test this PR:
<!--
This part is really important. If you want your PR to be merged, take the time to write very clear, annotated and step by step test instructions. Do not assume any previous knowledge - testers may not be developers.
-->
1. Open [mautic/mautic on Gitpod](https://gitpod.io/#https://github.com/mautic/mautic) or pull down for testing locally (see docs on testing PRs [here](https://contribute.mautic.org/contributing-to-mautic/tester)) - as you need to do some things before applying the PR.
1. Before you checkout this PR:
2. Create a form with at least 4 fields. One mapped to the contact email field, one mapped to the company field under the contact opt group, one mapped to the primary company city field. The fourth field should not be mapped to any field.
3. Check out this PR - in Gitpod on the left hand side, look for the Github icon, then find this PR and right click to checkout the PR:
![screenshot-mautic-mautic-oq31hzs9992 ws-eu85 gitpod io-2023 02 04-15_36_18](https://user-images.githubusercontent.com/2930593/216773288-7d0610a4-f7b8-45c9-a2fb-4dffdc7232d2.png)
5. Run the migration using the terminal tab.
Run `ddev exec bin/console doctrine:migrations:execute --up 20200415135706`. Note: you can roll back your changes with `ddev exec bin/console doctrine:migrations:execute --down 20200415135706` if needed.
6. Open PHPMyAdmin under the Ports tab on Gitpod, look for the port 8036. Open it in a tab.
7. Open the database named 'db' and go to the `form_fields` table and check that the last 2 columns are `mapped_object` and `mapped_field`. The field that was mapped to the contact email field should have `mapped_object = 'lead'` and `mapped_field = 'email'`. The one that was mapped to the company field under the contact opt group should have `mapped_object = 'lead'` and `mapped_field = 'company'`. The one that was mapped to the primary company city field should have `mapped_object = 'company'` and `mapped_field = 'companycity'`. The form field that was not mapped at all should have null values there.
8. When you map one field then it should be removed from mapping of other fields. Example: Map contact email field to a form field. Create another field. The contact email field is not in the mapping list.
9. Test submissions of different field types.
10. Test conditional fields
11. Test progressive profiling (behaviours)
#### List deprecations along with the new alternative:
1. `form_fields.lead_field` column is deprecated. Use `mapped_object` and `mapped_field` instead.
2. `Mautic\FormBundle\Entity\Field::getLeadField()` and `setLeadField()`. Use getters and setters on `mappedObject` and `mappedField` properties instead.
3. `Mautic\FormBundle\Event\Service\FieldValueTransformer::isIsTransformed()` is deprecated as not used.
<!--
If you have any deprecations, list them here along with the new alternative.
If you have any backwards compatibility breaks, list them here.
-->
<a href="https://gitpod.io/#https://github.com/mautic/mautic/pull/11905"><img src="https://gitpod.io/button/open-in-gitpod.svg"/></a>
And paste it to this new file app/migrations/Version20200415135706.php
Then run bin/console doctrine:migrations:migrate
to execute it.
1 Like
Thanks for the speedy fix @escopecz
system
Closed
January 11, 2024, 8:03am
8
This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.