J4 Issue ?
avatar richard67
richard67
30 Jul 2019

Steps to reproduce the issue

  1. Make new, clean installation with current 4.0-dev using a MySQL database.
  2. In admin, install testing sample data using the button on the control panel.
  3. Still in admin, edit the article "Joomla! Testing" and check which tags are assigned to that article.

Result: The article with title "Joomla! Testing" has 4 tags assigned: Tag names "2", "3", "4" and "5".

  1. Repeat steps 1 to 3 but use a PostgreSQL database this time.

(Ignore the error popup alert shown in step 3 with PostgreSQL when opening the article in edit mode. I'll write another issue soon).

Result: The article with title "Joomla! Testing" has 1 tag with name "2" assigned.

Expected result

No difference in testing sample data between MySQL and PostgreSQL database.

Actual result

Differences in testing sample data between MySQL and PostgreSQL database.

System information (as much as possible)

PHP 7.2
MySQL 5.7
PostgreSQL 10.9

Additional comments

I have not checked for other differences beside the example mentioned in the description above.

Since testing data now is done by plugin and not with the SQL scripts, I am a bit confused seeing differences. Or do I understand something wrong? => Ping @Hackwar

avatar richard67 richard67 - open - 30 Jul 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 Jul 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Jul 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 30 Jul 2019
avatar Bakual
Bakual - comment - 30 Jul 2019

Since testing data now is done by plugin and not with the SQL scripts, I am a bit confused seeing differences.

There shouldn't be a difference since the plugin uses the com_content article model to save the data.
Does assigning multiple tags work on PostgreSQL if you use the regular article form? Because in theory codewise that should be the same.

avatar richard67
richard67 - comment - 30 Jul 2019

It seems there is going something wrong with SQL when inserting sample data.

After I've made a clean install and then installed testing sample data, my tags table looks as follows on MySQL:

Tags-MySQL

On PostgreSQL it looks like this after the same conditions:

Tags-PostgreSQL

So it seems when those tags start with titles "2", "3" and so on, it crashes in PostgreSQL and insterts one last record which looks like part of a column definition e.g. from an SQL error message.

Could be something with data types being wrong.

@alikon Since you worked on the testing sample data stuff regarding PostgreSQL in your PR #25724 : Could you check if there are more errors in these PHP files which you have changed?

avatar franz-wohlkoenig franz-wohlkoenig - change - 31 Jul 2019
Status New Discussion
avatar Bakual
Bakual - comment - 31 Jul 2019

Afaik only the first 4 tags are correct, the ones with numbers look wrong to me.
If I had to guess, the article model tries to save the ID of the tags as a new tag instead of reference it.

avatar richard67
richard67 - comment - 31 Jul 2019

Now after PRs #25752 and #25724 have been merged so other PostgreSQL errors have gone, the issue described here is still valid. Deleting that wrong tag "2" works, assigning multiple of the other tags like e.g. "Red" or "Lime" to an article works, too, creating new tags works, so it seems the problem really comes from the testing sample data plugin.

avatar richard67
richard67 - comment - 3 Aug 2019

Meanwhile I know what the reason is for these unwanted tags "2", "3", "4" and "5": The article model expects titles and not ids as reference, so the testing sample data plugin needs a change as long as we don't change the article model. Why creation of the unwanted tags crashed in PostgreSQL is another problem. I am working on a PR to correct the first thing.

Another question is why we don't have unique constraints on such things like the tags title in our database, but that's current standard that we grant it to be unique by the inserting php code and don't have constraints in db.

avatar richard67
richard67 - comment - 3 Aug 2019

Hmm, no, does not work. Tags table is ok now, but article does not have tags.

avatar alikon
alikon - comment - 4 Aug 2019

@richard67 should be solved by #25773

avatar joomla-cms-bot joomla-cms-bot - change - 4 Aug 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-08-04 06:15:16
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 4 Aug 2019
avatar alikon alikon - change - 4 Aug 2019
Closed_By joomla-cms-bot alikon
avatar joomla-cms-bot
joomla-cms-bot - comment - 4 Aug 2019

Set to "closed" on behalf of @alikon by The JTracker Application at issues.joomla.org/joomla-cms/25747

Add a Comment

Login with GitHub to post a comment