Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
7 Oct 2025

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/5.3-dev/installation/sql/mysql/supports.sql#L305-L350 .

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.

Because 5.3-dev is close to end of life, I make this PR for 5.4-dev.

As it's not a release blocker it comes too late for 5.4.0 and 6.0.0, but will then hopefully go into 5.4.1 and 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:

ERROR:  duplicate key value violates unique constraint "j3ux0_ucm_content_idx_type_alias_item_id"
DETAIL:  Key (core_type_alias, core_content_item_id)=(com_content.article, 6) already exists.
STATEMENT:  INSERT INTO "j3ux0_ucm_content"
	("core_type_alias","core_title","core_alias","core_body","core_state","core_access","core_params","core_featured","core_metadata","core_created_user_id","core_created_by_alias","core_created_time","core_modified_user_id","core_modified_time","core_language","core_publish_up","core_content_item_id","asset_id","core_images","core_urls","core_hits","core_version","core_ordering","core_metakey","core_metadesc","core_catid","core_type_id") VALUES 
	('com_content.article','Your Template','your-template','<p>Templates control the look and feel of your website.</p>\r\n<p>This blog is installed with the Cassiopeia template.</p>\r\n<p>You can edit the options by selecting the Working on Your Site, Template Settings link in the menu which is visible when you log in.</p>\r\n<p>For example you can change the site background colour, highlights colour, site title, site description and title font used.</p>\r\n<p>More options are available in the site administrator. You may also install a new template using the extension manager.</p>\r\n<p>Blablabl.</p>',1,1,'{"article_layout":"","show_title":"","link_titles":"","show_tags":"","show_intro":"","info_block_position":"","info_block_show_title":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_hits":"","show_noauth":"","urls_position":"","alternative_readmore":"","article_page_title":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}',1,'{"robots":"","author":"","rights":""}',368,'Joomla','2025-10-07 07:57:32',368,'2025-10-07 08:28:15','*','2025-10-07 07:57:32',6,133,'{"image_intro":"images\\/sampledata\\/cassiopeia\\/nasa4-1200.jpg#joomlaImage:\\/\\/local-images\\/sampledata\\/cassiopeia\\/nasa4-1200.jpg?width=1200&height=400","image_intro_alt":"","image_intro_alt_empty":"1","float_intro":"","image_intro_caption":"","image_fulltext":"images\\/sampledata\\/cassiopeia\\/nasa4-400.jpg#joomlaImage:\\/\\/local-images\\/sampledata\\/cassiopeia\\/nasa4-400.jpg?width=400&height=400","image_fulltext_alt":"","image_fulltext_alt_empty":"1","float_fulltext":"float-start","image_fulltext_caption":"www.nasa.gov\\/multimedia\\/imagegallery"}','{"urla":"","urlatext":"","targeta":"","urlb":"","urlbtext":"","targetb":"","urlc":"","urlctext":"","targetc":""}',0,10,0,'','',8,1)
	RETURNING core_content_id

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

avatar richard67 richard67 - open - 7 Oct 2025
avatar richard67 richard67 - change - 7 Oct 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Oct 2025
Category Postgresql SQL Administration com_admin Installation
avatar richard67 richard67 - change - 7 Oct 2025
The description was changed
avatar richard67 richard67 - edited - 7 Oct 2025
avatar brianteeman brianteeman - test_item - 7 Oct 2025 - Tested successfully
avatar brianteeman
brianteeman - comment - 7 Oct 2025

I have tested this item ✅ successfully on 5439f5b

tested in j5 and 6


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46243.

avatar richard67
richard67 - comment - 7 Oct 2025

@brianteeman You have PostgreSQL? I didn't know that.

avatar brianteeman
brianteeman - comment - 7 Oct 2025

@brianteeman You have PostgreSQL? I didn't know that.

yes - ofc - currently only 14.5 - need to update

Add a Comment

Login with GitHub to post a comment