[wp-trac] [WordPress Trac] #17197: Attach media - search results not populating
WordPress Trac
wp-trac at lists.automattic.com
Thu Apr 21 15:16:20 UTC 2011
#17197: Attach media - search results not populating
--------------------------+-----------------------
Reporter: tomauger | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone:
Component: General | Version: 3.1
Severity: minor | Resolution:
Keywords: 2nd-opinion |
--------------------------+-----------------------
Comment (by duck_):
Replying to [comment:6 tomauger]:
> If the issue is extra whitespace creeping into the output of the Search
results (which TBH doesn't make sense to me, since HTML chomps whitespace
ordinarily), then why not run a quick RegExp that trims that whitespace
before outputting? (eg: s/^\s*// to trim leading whitespace). Just putting
an idea out there.
It seems that in this case the problem is that XML is being returned and
this is indicated by a text/xml Content-Type header. Unfortunately the
whitespace before the opening xml declaration means that jQuery throws an
error when trying to parse it. This means that the error AJAX callback is
used which tries to use the returned responseText which is the returned
XML, but strips all the XML tags leaving a CDATA tag which is displayed by
the browser but invisible.
We could check if textStatus == 'parseerror' and display a message in the
error callback.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17197#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list