[6.0] Fix saving content history on PostgreSQL #46269
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue # .
Summary of Changes
This pull request (PR) removes the wrong unique constraint for the "core_type_alias" and "core_content_item_id" column combination from the "#__ucm_content" table for PostgreSQL databases.
For MySQL we do not have that constraint, see https://github.com/joomla/joomla-cms/blob/6.0-dev/installation/sql/mysql/supports.sql#L307-L352 .
It is an old bug we have at least since Joomla 3.2.7. That was the oldest package I had here to check where the constraint exists for PostgreSQL but not for MySQL.
See also PR #46243 for 5.4-dev for the same bug.
As it's not a release blocker it comes too late for 6.0.0, but will then hopefully go into 6.0.1.
Testing Instructions
Important: It needs a PostgreSQL database to reproduce the issue and test the fix.
Have content history enabled and some articles which have multiple tags assigned.
You can achieve this my making a new installation and then installing blog sample data.
Then edit an article which has some tags assigned, e.g. in case of blog sample data the "Your Template" or any other in the "Blog" category.
Change the content of the article and remove some assigned tag and then use the "Save" button.
Check the edit page after it has reloaded.
Actual result BEFORE applying this Pull Request
With a MySQL or MariaDB database, all works. The content changes are shown, and the previously unassigned tag is not shown anymore.
With a PostgreSQL database, the reloaded page shows the previously unassigned tag again. Content changes are shown.
In the error log of the PostgreSQL server you will find:
Expected result AFTER applying this Pull Request
With a PostgreSQL database it works as well as with MySQL or MariaDB, the content changes are shown, and the previously unassigned tag is not shown anymore.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed