1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed "list-item-edit" without javascript not working

Discussion in 'Resolved Bug Reports' started by Luxus, Nov 18, 2012.

  1. Luxus

    Luxus Well-Known Member

    If you have permission, you can edit threads quickly with the small edit link floated right in a thread list item. With javascript enabled, this would open a grey area:


    With javascript disabled or if you right-click the edit link and open it in a new tab, you would get to the "thread_list_item_edit" page, but there you can't save or cancel. Pressing buttons does nothing. So this needs to be fixed for javascript haters.
    Jake Bunce likes this.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Confirmed. That form obviously wasn't made to be accessed as a regular page. As a quick fix, edit this template:

    Admin CP -> Appearance -> Templates -> thread_list_item_edit

    Add the red code:

    <xen:require css="thread_list_item_edit.css" />
    <form action="{xen:link 'threads/save', $thread}" method="post">
    	<div class="discussionListItemEdit inlineCtrlGroup">
    		<div class="titleEdit editBlock">
    			<label>{xen:phrase title}:
    				<xen:if is="{$prefixes}">
    					<xen:require js="js/xenforo/title_prefix.js" />
    					<xen:require css="title_prefix_edit.css" />
    					<select name="prefix_id" id="ctrl_prefix_{$thread.thread_id}" class="textCtrl TitlePrefix"
    						<xen:include template="title_prefix_edit_options">
    							<xen:set var="$selectedPrefix">{$thread.prefix_id}</xen:set>
    			<input type="text" name="title" value="{$thread.title}" class="textCtrl titleField" id="ctrl_title_{$thread.thread_id}" maxlength="100" />
    		<xen:if hascontent="true">
    			<div class="stateEdit editBlock">
    				<label for="ctrl_state_{$thread.thread_id}">{xen:phrase state}:
    					<select name="discussion_state" class="textCtrl" id="ctrl_state_{$thread.thread_id}">
    							<xen:if is="{$canAlterState.visible}"><option value="visible" {xen:selected "{$thread.discussion_state} == 'visible'"}>{xen:phrase visible}</option></xen:if>
    							<xen:if is="{$canAlterState.moderated}"><option value="moderated" {xen:selected "{$thread.discussion_state} == 'moderated'"}>{xen:phrase moderated}</option></xen:if>
    							<xen:if is="{$canAlterState.deleted}"><option value="deleted" {xen:selected "{$thread.discussion_state} == 'deleted'"}>{xen:phrase deleted}</option></xen:if>
    		<xen:if hascontent="true">
    			<ul class="optionsEdit editBlock">
    					<xen:if is="{$canLockUnlockThread}">
    						<li><label for="ctrl_open_{$thread.thread_id}" title="{xen:phrase people_may_reply_to_this_thread}"><input type="checkbox" name="discussion_open" value="1" id="ctrl_open_{$thread.thread_id}" {xen:checked "{$thread.discussion_open}"} /> {xen:phrase open_thread}</label></li>
    					<xen:if is="{$canStickUnstickThread}">
    						<li><label for="ctrl_sticky_{$thread.thread_id}"><input type="checkbox" name="sticky" value="1" id="ctrl_sticky_{$thread.thread_id}" {xen:checked "{$thread.sticky}"} /> {xen:phrase sticky}</label></li>
    		<div class="buttons editBlock">
    			<img src="@imagePath/xenforo/widgets/ajaxload.info_000000_facebook.gif" class="AjaxSaveProgress" alt="" />
    			<input type="submit" value="{xen:phrase save}" class="textCtrl primary" id="ctrl_submit_{$thread.thread_id}" data-submitUrl="{xen:link 'threads/save', $thread}" />
    			<input type="reset"  value="{xen:phrase cancel}" class="textCtrl" id="ctrl_reset_{$thread.thread_id}" />
    <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
    Luxus likes this.
  3. Mike

    Mike XenForo Developer Staff Member

    I've "fixed" this - this is JS only and opening it in a new window doesn't really make sense. Wrapping things in another form may cause some issues as the thread list is already within a form.

Share This Page