Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mglaman created an issue. See original summary.

davps’s picture

Status: Active » Needs review
FileSize
12.7 KB

Patch contains next changes:

  • Added 'created' field
  • Added 'changed' field
  • Update for existing stores with adding current timestamp as created/changed time
  • Updated stores list (views.view.commerce_stores)
mglaman’s picture

+1 at a quick review this looks correct. I'm at Decoupled Days and will try to find time to sit down and test it. I was going to add a "Needs tests" tag, but I'm not sure if it is worth testing these fields.

lisastreeter’s picture

I wasn't able to apply the patch because of EntityDuplicateFormTrait. This is a simple reroll to fix that. No other changes.

lisastreeter’s picture

Status: Needs review » Needs work

Attempted to run database updates. Got an infinite loop with message: Division by zero commerce_store.post_update.php:98

I'm working on a fresh commerce install that does not have any stores yet. Update hook needs to account for that possibility to avoid division by zero bug.

mkalkbrenner’s picture

Status: Needs work » Needs review
FileSize
11.75 KB
3.8 KB

I re-rolled the patch and removed redundant functions.

mkalkbrenner’s picture

mkalkbrenner’s picture

The patch is essential to get commerce stores to work better with default_content_deploy.

jsacksick’s picture

Writing a post update function to set the initial created/changed value isn't necessary. Also, not 100% sure this is what we want (i.e setting the created/changed timestamps to the current time).

But base field definitions have a way to specify the initial value (using the setInitialValue() method).

mkalkbrenner’s picture

I just re-rolled the patch as it solves our problems;-)
How can we get a decision about the default value for existing stores?

mkalkbrenner’s picture

FileSize
10.53 KB
1.96 KB

I removed to post updates like discussed with jsacksick on slack.

mkalkbrenner’s picture

FileSize
1.66 KB
10.57 KB

As discussed in slack, the StoreForm is now "similar" to ProductForm.
I also tested the form with existing stores after applying this patch. No exceptions and the created and changed dates will be set to request time on the first save. If you add the dates to a view they will simply have an empty value until the first modification happens.

jsacksick’s picture

It kind of feels weird to show the current date as "last saved" when the changed timestamp is empty.

Also, probably make sense to have a 2 columns layout, just like products.
Note that$this->time is available.

And, making the created editabledoesn't really make sense IMO.

jsacksick’s picture

Status: Needs review » Needs work
jsacksick’s picture

Status: Needs work » Needs review
FileSize
414.97 KB
14.25 KB

The attached patch no longer exposes the "created" time in the form. Also, made the changes mentioned in #13.

The store form has now a secondary region, containing the tax settings, the supported countries.

I also added the store owner, below the last saved timestamp. And add the top of the region, the default store shows "Default store", see the screenshot below:

jsacksick’s picture

Status: Needs review » Fixed

Committed!

  • jsacksick committed 397bf70 on 8.x-2.x
    Issue #3029848 by mkalkbrenner, jsacksick, lisastreeter, davps, mglaman...
mkalkbrenner’s picture

Thanks. I like the new UI.

  • jsacksick committed c5a6701 on 8.x-2.x
    Issue #3029848 followup: Add missing files.
    

Status: Fixed » Closed (fixed)

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