craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
219 stars 170 forks source link

[4.x]: Rendering bugs on Discounts index page #3457

Closed elivz closed 5 months ago

elivz commented 5 months ago

What happened?

Description

There are a number of bugs on the Discounts admin page of Commerce 4:

  1. The > on line 138 should instead be a .. Otherwise if there are date restrictions on a discount, the duration appears as false rather than the actual dates.
  2. Once that is fixed, the dates are not rendered correctly due to it using the wrong format for the date formatting string. Line 136 needs Locale::FORMAT_PHP as the final parameter.
  3. If a discount is disabled it appears in bold without the usual white circle indicator. I haven't managed to track down the cause of this...seems like it is using a different renderer for the name column when the item is disabled but I don't see an obvious reason why. This issue is also showing up on the Sales index, although the dates do display correctly there.

Craft CMS version

4.8.9

Craft Commerce version

4.5.3

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

linear[bot] commented 5 months ago

PT-1642 [4.x]: Rendering bugs on Discounts index page

lukeholder commented 5 months ago

Thanks for reporting this. Those issue are fixed for the next release: https://github.com/craftcms/commerce/pull/3460

I can't seem to reproduce the rendering issue for a disables discount:

CleanShot 2024-04-22 at 14 40 43@2x

Can you please make a new issue if the disabled rendering is still not working for you.

I will put a comment here once the date fix is in a release.

Thanks.

nfourtythree commented 5 months ago

This fix has been released as part of Commerce 4.5.4

Thanks!

elivz commented 5 months ago

Thanks! I am still seeing the issue with disabled discounts (and shipping methods), but traced it down to a regression in the VueAdminTable component in Craft core since 4.7.2. I have reported it over there.