WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 6 months ago

Last modified 4 months ago

#40662 closed defect (bug) (fixed)

Archive widget doesn't show the selected month name in the frontend widget itself

Reported by: Themonic Owned by: afercia
Milestone: 5.2 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: has-screenshots has-patch has-dev-note
Focuses: ui, accessibility, javascript Cc:

Description

Archive widget doesn't show the selected month name like the category widget shows the selected category name, although the widget works fine it always show "Select Month". Tested with Twenty Seventeen and several other themes.

Attachments (5)

40662.diff (5.2 KB) - added by robobot3000 2 years ago.
Added preselecting of the currently opened archive page in the archives dropdown widgets #wcpl2017
40662.2.diff (5.1 KB) - added by robobot3000 8 months ago.
Refreshed patch
40662.3.diff (5.1 KB) - added by robobot3000 8 months ago.
Restored an accidentally deleted PHPdoc @return
40662.4.diff (6.7 KB) - added by audrasjb 7 months ago.
Patch refreshed and added full documentation for the new feature.
40662.5.diff (7.4 KB) - added by afercia 6 months ago.

Download all attachments as: .zip

Change History (32)

#1 @afercia
2 years ago

  • Keywords has-screenshots needs-patch added
  • Version 4.7.4 deleted

Confirmed, when both widgets are set to "Display as dropdown".

Screenshots to illustrate what happens after selecting a category/archive month and page reloads. Worth noting these selects have other accessibility issues (they should not use the change event and have a button to submit) but they should be addressed in a separate ticket. Also, they don't have a no-js fallback.

the selected category is preserved:

https://cldup.com/ZnofclMmaH.png

the selected month isn't:

https://cldup.com/8PztTWbt4I.png

Last edited 2 years ago by afercia (previous) (diff)

@robobot3000
2 years ago

Added preselecting of the currently opened archive page in the archives dropdown widgets #wcpl2017

#2 @robobot3000
2 years ago

  • Keywords has-patch added; needs-patch removed

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


2 years ago

#4 @afercia
2 years ago

  • Milestone changed from Awaiting Review to 4.8.1

Thanks @robobot3000 ! And hello #wcpl2017! Yep, needs to take care of all the cases, yearly/monthly/weekly/daily/. Looks good!

#5 @westonruter
2 years ago

  • Milestone changed from 4.8.1 to 4.9

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


2 years ago

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


2 years ago

#8 @afercia
2 years ago

  • Owner set to davidakennedy
  • Status changed from new to assigned

#9 @westonruter
2 years ago

  • Milestone changed from 4.9 to 4.9.1

This ticket was mentioned in Slack in #core by westonruter. View the logs.


2 years ago

#11 @johnbillion
22 months ago

  • Milestone changed from 4.9.1 to 5.0

#12 @taylorgorman
22 months ago

  • Focuses ui removed
  • Keywords ux-feedback added

#13 @taylorgorman
22 months ago

  • Focuses ui added
  • Keywords ux-feedback removed

This ticket was mentioned in Slack in #accessibility by rianrietveld. View the logs.


12 months ago

#15 @peterwilsoncc
12 months ago

  • Milestone changed from 5.0 to 5.1

Moving to the 5.1 milestone due to the WordPress 5.0 focus on the new
editor (Gutenberg).

#16 @pento
8 months ago

  • Keywords needs-refresh added
  • Milestone changed from 5.1 to Future Release

Patch needs refresh and testing/review.

@robobot3000
8 months ago

Refreshed patch

#17 @robobot3000
8 months ago

  • Keywords needs-testing added; needs-refresh removed

Attached an updated version of the patch

@robobot3000
8 months ago

Restored an accidentally deleted PHPdoc @return

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


8 months ago

#19 @afercia
8 months ago

  • Milestone changed from Future Release to 5.2

Moving to 5.2 consideration.

@audrasjb
7 months ago

Patch refreshed and added full documentation for the new feature.

#20 @audrasjb
7 months ago

  • Keywords needs-dev-note added
  • Owner changed from davidakennedy to audrasjb

In 40662.4.diff, I refreshed the last patch against trunk and I added the full inline Documentation for the new feature.

Also, I believe this ticket will deserve a little Dev note if it lands in 5.2.

Cheers,
Jb

#21 @afercia
7 months ago

  • Keywords needs-refresh added; needs-testing removed

Noticed a couple things:

1
The patch needs some coding standards. Please run
phpcs --standard=phpcs.xml.dist src/wp-includes/general-template.php

and fix all the warning/errors marked with [x]

2
As a long-term goal, these selects shouldn't use the change event. For now, there's the need to address a behavior that didn't matter before but is now relevant:

  • select a month
  • the page reloads displaying the correct month
  • select again the default option "Select Month"
  • the page reloads: this shouldn't happen
  • comparing with what the Categories select does, the JavaScript should be modernized a bit and not trigger a page reload when the default option is selected
  • this means the markup should be changed too, to wrap the select with a <form> element (see for inspiration the Categories widget)

#22 @afercia
6 months ago

  • Owner changed from audrasjb to afercia

Will refresh the patch.

@afercia
6 months ago

#23 @afercia
6 months ago

  • Keywords commit added; needs-refresh removed

40662.5.diff makes phpcs happy and updates the JS part. No need for a <form> element in this case. Looks good to me.

This ticket was mentioned in Slack in #core by afercia. View the logs.


6 months ago

#25 @SergeyBiryukov
6 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 44897:

Widgets: Pre-select currently viewed archive in the Archives dropdown widget, for consistency with the Categories widget.

Props robobot3000, audrasjb, afercia, Themonic.
Fixes #40662.

#26 @SergeyBiryukov
6 months ago

In 44898:

Docs: Add a @since tag for the new $selected parameter of get_archives_link().

See #40662.

#27 @desrosj
4 months ago

  • Keywords has-dev-note added; needs-dev-note commit removed
Note: See TracTickets for help on using tickets.