In order to progress #1571632: Convert regional settings to configuration system I'm splitting the work we are doing to convert Date formats to a this issue. Here we will focus on:

  • getting date formats to use configuration as a storage medium instead of database tables.
  • supporting the work to get parts of the date module into core
  • simplify the data model for date formats as a result.

Comments

cosmicdreams’s picture

StatusFileSize
new78.12 KB

Here's the our last patch from the previous issue.

cosmicdreams’s picture

Status: Active » Needs review

set to review to see if we get the same number of fails (~20)

Status: Needs review » Needs work

The last submitted patch, 1571632_109_0.patch, failed testing.

cosmicdreams’s picture

StatusFileSize
new78.12 KB

not only did the patch not apply, but if it had it wouldn't install. Here's the rerolled patch:

* fixed the broken update function name
* fixed improper use of the date format save.

cosmicdreams’s picture

Status: Needs work » Needs review

Wow, I was having frustrating internet connectivity issues last night and didn't think this actually posted. setting to review to see if this can at least be applied.

Status: Needs review » Needs work

The last submitted patch, 1571632_109_0.patch, failed testing.

cosmicdreams’s picture

Status: Needs work » Needs review
+++ b/core/modules/system/config/system.date.ymlundefined
@@ -0,0 +1,50 @@
+formats:
+  system_long:
+    name: "Default Long Date"
+    pattern: 'l, F j, Y - H:i'
+    locked: 0
+  system_medium:
+    name: "Default Medium Date"
+    pattern: 'D, m/d/Y - H:i'
+    locked: 0
+  system_short:
+    name: "Default Short Date"
+    pattern: 'm/d/Y - H:i'
+    locked: 0
+  html_datetime:
+    name: "HTML Datetime"
+    pattern: 'Y-m-d\TH:i:sO'
+    locked: 1
+  html_date:
+    name: "HTML Date"
+    pattern: 'Y-m-d'
+    locked: 1
+  html_time:
+    name: 'HTML Time'
+    pattern: 'H:i:s'
+    locked: 1
+  html_yearless_date:
+    name: 'HTML Yearless date'
+    pattern: 'm-d'
+    locked: 1
+  html_week:
+    name: 'HTML Week'
+    pattern: 'Y-\WW'
+    locked: 1
+  html_month:
+    name: 'HTML Month'
+    pattern: 'Y-m'
+    locked: 1
+  html_year:
+    name: 'HTML Year'
+    pattern: 'Y'

Here's where we'll modify the config of formats to store format strings that support the legacy system and IntlDateFormatter

+++ b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.phpundefined
@@ -35,15 +35,19 @@ class FormatDateTest extends WebTestBase {
+      ->set('timezone.user.configurable', 1)

Allow the regional config patch to handle this.

I think this patch has most of this working so I'm leaving this in for now until the regional config patch diverges.

Also, we previously discussed how using ConfigEntities / Configurables could benefit this patch. I'm not sure if that effort should be tackled with this patch or a follow up.

cosmicdreams’s picture

StatusFileSize
new72.72 KB

Ah, looks like my previous patch was uploaded twice. ok, here's the patch I really meant to test.

Status: Needs review » Needs work

The last submitted patch, 1808246_8_date_formats.patch, failed testing.

cosmicdreams’s picture

Status: Needs work » Needs review
StatusFileSize
new73.32 KB

My previous fixes weren't included in that patch. This one fixes:

  • system.install: updated the function name to use a named that is available
  • cleaned up extra code that was the result of an unsuccessful reroll

Status: Needs review » Needs work

The last submitted patch, 1808246_10_date_formats.patch, failed testing.

cosmicdreams’s picture

I've run a test locally and I'm passing it. The funny thing is I've only cleaned up some stray code that seem to have been misplaced after I rerolled that patch. I'm posting this patch to see how many other things are now magically fixed.

cosmicdreams’s picture

StatusFileSize
new71.7 KB

I've run a test locally and I'm passing it. The funny thing is I've only cleaned up some stray code that seem to have been misplaced after I rerolled that patch. I'm posting this patch to see how many other things are now magically fixed.

cosmicdreams’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1808246_12.patch, failed testing.

cosmicdreams’s picture

Status: Needs work » Needs review
StatusFileSize
new74.61 KB

I've fixed a few of the fails here but I don't know how many. This patch seems to fail when saving "custom" date formats.

Status: Needs review » Needs work

The last submitted patch, 1808246_16.patch, failed testing.

larowlan’s picture

+1 for config entities and list controller.

marcingy’s picture

Status: Needs work » Postponed

Making as postponed lets work on a simple port in #1571632: Convert regional settings to configuration system first. While this might be nice lets keep it simple and kill some tables and not divide effort.

cosmicdreams’s picture

@marcingy
I think it's fine if you want to mark this issue postponed. I've mainly opened this issue up so that I can do everything I can to not block the work you are planning to do on the regional CMI issue. I plan to continue to post patches here until we can have a code-level discussion about the merits of our two designs. Please don't take that action as a rejection of your involvement. I just don't want to stop working on a solution.

I have very little time to work on core now that my day-job has intensified. I hope the extra load is resolved soon (once we hire a few more Drupal devs). Even after then, I hope to make the most of my time. If you want we can collaborate over irc, Skype, Google+ Hangouts, or whatever would be beneficial to help this issue come to a close.

Please let me know what is feasible.

karens’s picture

Now that #1571632: Convert regional settings to configuration system has landed, is there still something else to do here or is this now unneeded?

cosmicdreams’s picture

Status: Postponed » Fixed

You're right this one is finished as a result of that other issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.