Make WordPress Core

Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#40662 closed defect (bug) (fixed)

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

Reported by: themonic's profile Themonic Owned by: afercia's profile 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 8 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 6 years ago.
Refreshed patch
40662.3.diff (5.1 KB) - added by robobot3000 6 years ago.
Restored an accidentally deleted PHPdoc @return
40662.4.diff (6.7 KB) - added by audrasjb 6 years ago.
Patch refreshed and added full documentation for the new feature.
40662.5.diff (7.4 KB) - added by afercia 6 years ago.

Download all attachments as: .zip

Change History (32)

#1 @afercia
8 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 categiry/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

Version 0, edited 8 years ago by afercia (next)

@robobot3000
8 years ago

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

#2 @robobot3000
8 years ago

  • Keywords has-patch added; needs-patch removed

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


8 years ago

#4 @afercia
8 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
7 years ago

  • Milestone changed from 4.8.1 to 4.9

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


7 years ago

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


7 years ago

#8 @afercia
7 years ago

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

#9 @westonruter
7 years ago

  • Milestone changed from 4.9 to 4.9.1

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


7 years ago

#11 @johnbillion
7 years ago

  • Milestone changed from 4.9.1 to 5.0

#12 @taylorgorman
7 years ago

  • Focuses ui removed
  • Keywords ux-feedback added

#13 @taylorgorman
7 years ago

  • Focuses ui added
  • Keywords ux-feedback removed

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


6 years ago

#15 @peterwilsoncc
6 years 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
6 years ago

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

Patch needs refresh and testing/review.

@robobot3000
6 years ago

Refreshed patch

#17 @robobot3000
6 years ago

  • Keywords needs-testing added; needs-refresh removed

Attached an updated version of the patch

@robobot3000
6 years ago

Restored an accidentally deleted PHPdoc @return

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


6 years ago

#19 @afercia
6 years ago

  • Milestone changed from Future Release to 5.2

Moving to 5.2 consideration.

@audrasjb
6 years ago

Patch refreshed and added full documentation for the new feature.

#20 @audrasjb
6 years 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
6 years 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 years ago

  • Owner changed from audrasjb to afercia

Will refresh the patch.

@afercia
6 years ago

#23 @afercia
6 years 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 years ago

#25 @SergeyBiryukov
6 years 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 years ago

In 44898:

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

See #40662.

#27 @desrosj
6 years ago

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