Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 8 weeks ago

#40954 closed defect (bug) (invalid)

Create Category within posts screen error

Reported by: cfastenrath's profile cfastenrath Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8
Component: Posts, Post Types Keywords: close
Focuses: javascript Cc:


When creating a new category within the "create posts" screen (post.php), there will be a javascript error. The new category will be created, but is only visible after refresh of the page.

It is a completely fresh installation of wordpress. Updated to 4.8.
Only default themes and plugins are activated.

Uncaught TypeError: Cannot read property '0' of undefined
    at Object.c [as addAfter] (load-scripts.php:115)
    at (load-scripts.php:10)
    at i (load-scripts.php:2)
    at Object.fireWith (load-scripts.php:2)
    at y (load-scripts.php:4)
    at XMLHttpRequest.c (load-scripts.php:4)

Response from admin-ajax call:

<?xml version='1.0' encoding='UTF-8' standalone='yes'?><wp_ajax><response action='add-category_9'><category id='9' position='-1'><response_data><![CDATA[<li id='category-9'><label class="selectit"><input value="9" type="checkbox" name="post_category[]" id="in-category-9" checked='checked' /> again</label></li>]]></response_data><supplemental><newcat_parent><![CDATA[<select  name='newcategory_parent' id='newcategory_parent' class='postform' >
	<option value='-1'>&mdash; Übergeordnete Kategorie &mdash;</option>
	<option class="level-0" value="9">again</option>
	<option class="level-0" value="1">Allgemein</option>
	<option class="level-0" value="8">Nochmal</option>
	<option class="level-0" value="7">Test</option>

Change History (2)

#1 @cfastenrath
7 years ago

  • Keywords close added
  • Resolution set to invalid
  • Status changed from new to closed

There were additional lines after the closing php tag in an uploaded file in the plugin folder.
Therefore headers were already sent which results in this error!.

#2 @SergeyBiryukov
7 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.