Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PostgreSQL failure #65

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Conversation

muhme
Copy link

@muhme muhme commented Aug 12, 2024

With the PR joomla#43862 there are two exceptions if as database PostgreSQL is used.

`ERROR: column "m.language" must appear in the GROUP BY clause or be used in an aggregate function`

If the columns in GROUP BY are simple added again, there are multiple menu entries shown if multiple home set in one menu.

Solution is to use the aggregate function MAX.

Tested with

  • ✅ PostgreSQL PDO
  • ✅ MySQL with MySQLi
  • ✅ MySQL with MySQL PDO
  • ✅ MariaDB with MySQL PDO
  • ✅ MariaDB with MySQLi

On base of:

  • PR 43862 with Patch Tester
  • npm update joomla-cypress 1.1.1
  • this PR fix-postgres
  • npx cypress run --spec tests/System/integration/install/multi-lang-menu.cy.js (attached as .txt)
Test Support PR 43862 with
✓ install Japanese language pack  (9784ms)
✓ install Ukrainian language pack (8487ms)
✓ install German language pack (8309ms)
✓ enable plugin 'System - Language filter' (1903ms) ✓ create '2nd menu' (1484ms)
✓ create 1st menu entry de as HOME in '2nd menu' (5601ms)
✓ create 2nd menu entry ja as HOME in '2nd menu' (4936ms)
✓ create 3rd menu entry uk as HOME in '2nd menu' (5392ms)
✓ create '3rd menu' (1434ms)
  • checked five times that the HOME symbol is displayed if more than one Home menu entry is set, otherwise the correct language (uk-UA, ja-JP or de-DE) is displayed for each of the three entries if there is only one menu entry with Home

see multi-lang-menu.cy.js.txt and
screenshot

With the PR there are two exceptions if as database is PostgreSQL is used.
`ERROR: column "m.language" must appear in the GROUP BY clause or be used in an aggregate function`

If the columns in GROUP BY are simple added again, there are multiple
menu entries if multiple home set in one menu.

Solution is to use the aggregat function MAX.

Tested with
* PostgreSQL PDO
* MySQL with MySQLi
* MySQL with MySQL PDO
* MariaDB with MySQL PDO
* MariaDB with MySQLi

On base of
* PR 43862 with Patch Tester
* npm update joomla-cypress 1.1.1
* this PR fix-postgres
* npx cypress run --spec tests/System/integration/install/multi-lang-menu.cy.js
Test Support PR 43862 with
✓ install Japanese language pack  (9784ms)
✓ install Ukrainian language pack (8487ms)
✓ install German language pack (8309ms)
✓ enable plugin 'System - Language filter' (1903ms)
✓ create '2nd menu' (1484ms)
✓ create 1st menu entry de as HOME in '2nd menu' (5601ms)
✓ create 2nd menu entry ja as HOME in '2nd menu' (4936ms)
✓ create 3rd menu entry uk as HOME in '2nd menu' (5392ms)
✓ create '3rd menu' (1434ms)

* checked five times that the HOME symbol is displayed if more than one Home menu entry is set,
  otherwise the correct language (uk-UA, ja-JP or de-DE) is displayed for each of the three entries
  if there is only one menu entry with Home
@Hackwar Hackwar merged commit 7d82dcd into Hackwar:5.2-langhomemenuitem Aug 13, 2024
@muhme muhme deleted the fix-postgres branch August 13, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants