Make WordPress Core

Opened 12 years ago

Closed 8 years ago

Last modified 8 years ago

#20714 closed enhancement (fixed)

Theme customizer: Impossible to preview a search results page

Reported by: johnbillion's profile johnbillion Owned by: westonruter's profile westonruter
Milestone: 4.7 Priority: normal
Severity: normal Version: 3.4
Component: Customize Keywords: has-patch commit
Focuses: javascript Cc:

Description

Steps to reproduce:

  1. Open the theme customizer
  2. Attempt to do a search in the site's search box in order to preview the search results page

The form won't submit and you won't be able to preview your search results.

Attachments (1)

20714.0.diff (1.5 KB) - added by westonruter 8 years ago.

Download all attachments as: .zip

Change History (22)

#1 @scribu
12 years ago

  • Cc scribu added

#2 @scribu
12 years ago

Confirmed. Since normal links do work, I assume it would also be possible for GET forms to work as well. Not sure about POST forms.

#4 @nacin
12 years ago

  • Type changed from defect (bug) to enhancement

By design. Setting this to an enhancement.

#5 @nacin
11 years ago

  • Component changed from Themes to Appearance

#6 @westonruter
10 years ago

Actually, you can preview a search results page. You just can't access the search results by navigating within the customizer. The workaround is to do the search on the frontend, and then on the search results page, access the Customize link from the admin bar, and it will load up the Customizer with the preview open to that search results page, e.g.: http://src.wordpress-develop.dev/wp-admin/customize.php?url=http%3A%2F%2Fsrc.wordpress-develop.dev%2F%3Fs%3Dtest

#7 @westonruter
10 years ago

  • Keywords needs-patch added

This ticket was mentioned in IRC in #wordpress-dev by westonruter. View the logs.


10 years ago

#9 @westonruter
10 years ago

  • Focuses javascript added
  • Milestone changed from Awaiting Review to Future Release

#10 @westonruter
10 years ago

I've been working on this as a part of #30028, which would ensure that the Customizer can be used to preview all form submissions and even Ajax requests.

#11 @westonruter
10 years ago

Previewing of form submissions (both POST and GET requests), as well as jQuery Ajax requests, have been implemented at https://github.com/xwp/wordpress-develop/pull/61

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


9 years ago

#13 @westonruter
8 years ago

  • Milestone changed from Future Release to 4.6

This ticket was mentioned in Slack in #core-customize by celloexpressions. View the logs.


8 years ago

#15 @westonruter
8 years ago

  • Milestone changed from 4.6 to Future Release

Punting due to transactions being too large to finish patch and test in time for 4.6.

#16 @westonruter
8 years ago

  • Milestone changed from Future Release to 4.7
  • Owner set to westonruter
  • Status changed from new to accepted

I just realized a very simple fix for this, and it's not dependent on transactions at all. All we have to do is listen for form submit events and if the form has a GET request method and if the action points to a URL for the current WP instance, then we can just serialize the form's data and amend it to the action URL and send this new URL in the url message to the Customizer pane, just as happens when clicking a regular link. See https://github.com/xwp/wp-customize-snapshots/pull/72/files#diff-56102a3fdc293b051600c9ab9fedc164R145

@westonruter
8 years ago

#17 @westonruter
8 years ago

  • Keywords has-patch added; needs-patch removed

@johnbillion how does 20714.0.diff work for you?

#18 @westonruter
8 years ago

  • Keywords commit added

I'll commit unless there is any feedback to the contrary.

#19 @johnbillion
8 years ago

  • Status changed from accepted to assigned

Looks good @westonruter.

#20 @westonruter
8 years ago

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

In 38587:

Customize: Implement previewing of form submissions which use the GET method.

This finally allows the search results template to navigated to in the customizer preview.

Fixes #20714.

#21 @westonruter
8 years ago

In 38588:

Docs: Fix phpdoc and jsdoc typos introduced in [38584] and [38587], respectively.

See #33742.
See #20714.

Note: See TracTickets for help on using tickets.