Skip to content

Conversation

richard67
Copy link
Member

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:

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

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on f047879


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

@richard67
Copy link
Member Author

I've restored the previous human test result as the commits which have invalidated the test count were just a rename of the update SQL script (so it doesn't make problems for another PR) and a clean branch update.

@Bodge-IT
Copy link
Contributor

I have tested this item ✅ successfully on c2abc10

Thanks Richard, good catch.


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

@Bodge-IT Bodge-IT added this to the Joomla! 6.0.0 milestone Oct 11, 2025
@Bodge-IT Bodge-IT added the RTC This Pull Request is Ready To Commit label Oct 11, 2025
@softforge softforge merged commit ef7b7e0 into joomla:6.0-dev Oct 11, 2025
31 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Oct 11, 2025
@softforge
Copy link
Contributor

Thank you @richard67 and testers

@richard67 richard67 deleted the 6.0-dev-fix-ucm-content-postgresql branch October 11, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants