Skip to content

Conversation

@richard67
Copy link
Member

@richard67 richard67 commented Feb 8, 2020

Pull Request for #25258 (comment).

Summary of Changes

With PR #25258 meta keywords have been removed from diverse forms and views.

This is a good thing.

But the fields in database tables still exist, have a NOT NULL constraint and partly no default value, e.g. in the #__languages table.

This leads to content language not being installed when installing a language, see #25258 (comment).

Furthermore I saw fields metakey are still used by diverse sample data, so we can't just remove those columns, not yet.

So this PR removes the NOT NULL constraint from metakey columns where they are of type text, because for such columns default values are not allowed in strict mode, and adds missing default value empty string to those columns where they are of type VARCHAR, so things don't fail and stay BC.

Later when all metaky removal has been completed we can remove those columns from database tables with another PR, wherever appropriate (BC?).

Testing Instructions

Update

  1. On a current 4.0-dev installation, apply the changes in the update sql script 4.0.0-2020-02-08.sql added by this PR e.g. with PhpMyAdmin or PhpPgAdmin, replacing #___ by your actual db prefix.

  2. Install Persian language.
    Result: Content language created, no notice like shown in comment [4.0] Remove Meta Keywords (part 1) #25258 (comment).

  3. Verify that following still works:

  • Creating and editing banners and banner clients
  • Creating and editing contacts
  • Creating and editing articles
  • Creating and editing newsfeeds
  • Creating and editing tags

New installation

  1. Apply PR on a clean current 4.0-dev and then make new installation.

  2. to 3. Same as for update above.

Expected result

Code review/database check: All database columns for meta keywords have default value '' where they are of type VARCHAR and have no default and allow NULL values where they are of type TEXT.

Language installation test (step 2): No notice, and content language is created.

Other tests (step 3): Things work.

Actual result

Code review/database check: There are some database columns for meta keywords having a NOT NULL constraint and no default value.

Language installation test (step 2): Notice shown, and content language not created.

j4-install-persian-language-notice

Other tests (step 3): Things work.

Documentation Changes Required

None.

@richard67
Copy link
Member Author

@brianteeman Done. I won't change the comments with update SQL scripts because we never do that for comments only.

@Quy
Copy link
Contributor

Quy commented Feb 8, 2020

I have tested this item ✅ successfully on 2723a32


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

@richard67
Copy link
Member Author

Thinking about it ... maybe I should change this to null values instead of empty strings? Is late here, I have to check tomorrow.

@brianteeman
Copy link
Contributor

I did wonder about that but you're the sql guru

@alikon
Copy link
Contributor

alikon commented Feb 9, 2020

from https://dev.mysql.com/doc/refman/8.0/en/blob.html

BLOB and TEXT columns cannot have DEFAULT values.

@richard67
Copy link
Member Author

You shall not trust gurus 😝

@richard67
Copy link
Member Author

I should not have looked into joomla.sql to see how it should be done ... is all wrong there. There is a PR which wants to fix that for staging, #17860 , but it it missing something, and the author seems not to be available anymore. Have pinged him yesterday. Let's wait a bit and give him time. For this PR here I will check if I can provide a correction, and if not I'll close it and make an issue.

@Quy Thanks for pointing me to that other PR. Clould you set back your test result to "not tested" for my PR here?

@richard67
Copy link
Member Author

@alikon @brianteeman @Quy PR modified, descriptions and testing instructions updated. Ready for testing.

@infograf768
Copy link
Member

I have tested this item ✅ successfully on f08bcf4


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

@infograf768
Copy link
Member

rather urgent to get in as multilingual is dead fish. ;)

@Quy
Copy link
Contributor

Quy commented Feb 9, 2020

I have tested this item ✅ successfully on f08bcf4


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

@Quy
Copy link
Contributor

Quy commented Feb 9, 2020

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 9, 2020
@rdeutz rdeutz added this to the Joomla 4.0 milestone Feb 10, 2020
@rdeutz rdeutz merged commit 69833c3 into joomla:4.0-dev Feb 10, 2020
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 10, 2020
@richard67 richard67 deleted the 4.0-dev-fix-language-installation-no-meta-keywords branch February 10, 2020 08:08
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.

7 participants