WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 7 months ago

Last modified 7 months ago

#20714 closed enhancement (fixed)

Theme customizer: Impossible to preview a search results page

Reported by: johnbillion Owned by: 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 7 months ago.

Download all attachments as: .zip

Change History (22)

#1 @scribu
5 years ago

  • Cc scribu added

#2 @scribu
5 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.

#3 @ocean90
5 years ago

Since it's not implemented, yes, all forms are disabled yet.

See http://core.trac.wordpress.org/browser/trunk/wp-includes/js/customize-preview.dev.js#L40

#4 @nacin
5 years ago

  • Type changed from defect (bug) to enhancement

By design. Setting this to an enhancement.

#5 @nacin
3 years ago

  • Component changed from Themes to Appearance

#6 @westonruter
3 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
3 years ago

  • Keywords needs-patch added

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


3 years ago

#9 @westonruter
3 years ago

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

#10 @westonruter
2 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
2 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.


17 months ago

#13 @westonruter
11 months ago

  • Milestone changed from Future Release to 4.6

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


11 months ago

#15 @westonruter
10 months 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 months 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
7 months ago

#17 @westonruter
7 months ago

  • Keywords has-patch added; needs-patch removed

@johnbillion how does 20714.0.diff work for you?

#18 @westonruter
7 months ago

  • Keywords commit added

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

#19 @johnbillion
7 months ago

  • Status changed from accepted to assigned

Looks good @westonruter.

#20 @westonruter
7 months 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
7 months 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.