forked from joomla/joomla-cms
-
Notifications
You must be signed in to change notification settings - Fork 1
Handle UCM content and not nullable datetime columns, too, and do other fixes from code reviews #41
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
Merged
wilsonge
merged 10 commits into
wilsonge:bugfix/date-columns
from
richard67:4.0-dev-bugfix-datetime-columns-mod-4
Sep 28, 2019
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a6203d2
SQL for ucm content
richard67 dddc298
PHP changes for ucm content
richard67 a35045b
Update libraries/src/Table/CoreContent.php
richard67 05b55bb
No use of nulldate for modified column
richard67 f3eb0aa
Don't use nullDate in ArticlesModel
richard67 fb79a4d
Don't handle not nullable ucm content columns
richard67 3445b7a
Handle also not nullable datetime columns
richard67 e4fd74a
Fix ucm content core modified time
richard67 d18fc52
Handle also #__ucm_history save_date
richard67 f05c532
Merge branch 'bugfix/date-columns' into 4.0-dev-bugfix-datetime-colum…
richard67 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-08-01.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ALTER TABLE `#__ucm_content` MODIFY `core_created_time` datetime NOT NULL; | ||
| ALTER TABLE `#__ucm_content` MODIFY `core_modified_time` datetime NOT NULL; | ||
|
|
||
| ALTER TABLE `#__ucm_content` MODIFY `core_publish_up` datetime NULL DEFAULT NULL; | ||
| ALTER TABLE `#__ucm_content` MODIFY `core_publish_down` datetime NULL DEFAULT NULL; | ||
| ALTER TABLE `#__ucm_content` MODIFY `core_checked_out_time` datetime NULL DEFAULT NULL; | ||
|
|
||
| ALTER TABLE `#__ucm_history` MODIFY `save_date` datetime NOT NULL; |
19 changes: 19 additions & 0 deletions
19
administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-09-14.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,26 @@ | ||
| ALTER TABLE `#__content` MODIFY `created` datetime NOT NULL; | ||
| ALTER TABLE `#__content` MODIFY `modified` datetime NOT NULL; | ||
|
|
||
| ALTER TABLE `#__content` MODIFY `publish_up` datetime NULL DEFAULT NULL; | ||
| ALTER TABLE `#__content` MODIFY `publish_down` datetime NULL DEFAULT NULL; | ||
| ALTER TABLE `#__content` MODIFY `checked_out_time` datetime NULL DEFAULT NULL; | ||
|
|
||
| UPDATE `#__content` SET `modified` = `created` WHERE `modified` = '0000-00-00 00:00:00'; | ||
|
|
||
| UPDATE `#__content` SET `publish_up` = NULL WHERE `publish_up` = '0000-00-00 00:00:00'; | ||
| UPDATE `#__content` SET `publish_down` = NULL WHERE `publish_down` = '0000-00-00 00:00:00'; | ||
| UPDATE `#__content` SET `checked_out_time` = NULL WHERE `checked_out_time` = '0000-00-00 00:00:00'; | ||
|
|
||
| UPDATE `#__ucm_content` SET `core_modified_time` = `core_created_time` | ||
| WHERE `core_type_alias` = 'com_content.article' | ||
| AND `core_modified_time` = '0000-00-00 00:00:00'; | ||
|
|
||
| UPDATE `#__ucm_content` SET `core_publish_up` = NULL | ||
| WHERE `core_type_alias` = 'com_content.article' | ||
| AND `core_publish_up` = '0000-00-00 00:00:00'; | ||
| UPDATE `#__ucm_content` SET `core_publish_down` = NULL | ||
| WHERE `core_type_alias` = 'com_content.article' | ||
| AND `core_publish_down` = '0000-00-00 00:00:00'; | ||
| UPDATE `#__ucm_content` SET `core_checked_out_time` = NULL | ||
| WHERE `core_type_alias` = 'com_content.article' | ||
| AND `core_checked_out_time` = '0000-00-00 00:00:00'; |
14 changes: 14 additions & 0 deletions
14
administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-08-01.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ALTER TABLE "#__ucm_content" ALTER COLUMN "core_created_time" DROP DEFAULT; | ||
|
|
||
| ALTER TABLE "#__ucm_content" ALTER COLUMN "core_modified_time" DROP DEFAULT; | ||
|
|
||
| ALTER TABLE "#__ucm_content" ALTER COLUMN "core_publish_up" DROP NOT NULL; | ||
| ALTER TABLE "#__ucm_content" ALTER COLUMN "core_publish_up" DROP DEFAULT; | ||
|
|
||
| ALTER TABLE "#__ucm_content" ALTER COLUMN "core_publish_down" DROP NOT NULL; | ||
| ALTER TABLE "#__ucm_content" ALTER COLUMN "core_publish_down" DROP DEFAULT; | ||
|
|
||
| ALTER TABLE "#__ucm_content" ALTER COLUMN "core_checked_out_time" DROP NOT NULL; | ||
| ALTER TABLE "#__ucm_content" ALTER COLUMN "core_checked_out_time" DROP DEFAULT; | ||
|
|
||
| ALTER TABLE "#__ucm_history" ALTER COLUMN "save_date" DROP DEFAULT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wilsonge Here and in the following line you have to advise me if that is ok or if there has to be something done for one of the range start and end dates being not specified, or both even. The existing code might do the wrong thing in such case, if that case is allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the options for this? We've effectively mandated
a.createdanda.modifiedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, these here are start and end dates for a range filtering, i think. they are entered in a filter. the date to be fitered for is either created or modified, but my question above refers to that start and end dates of the range for filtering. or am i getting something wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok can be
a.publish_up(mod_articles_popular and mod_articles_category). Just need to test this still works