CMS MADE SIMPLE FORGE

Module Generator

 

[#8435] Sub Category Reorder Bug

avatar
Created By: Cameron (smokeycam)
Date Submitted: Tue Sep 25 04:49:28 -0400 2012

Assigned To: Zdeno Kuzmany (xxl)
Version: 2.2.3
CMSMS Version: 1.11.2
Severity: None
Resolution: Fixed
State: Open
Summary:
Sub Category Reorder Bug
Detailed Description:
Hi there,

Appears there is a bug when trying to reorder sub categories, although the top
level categories reorder, the sub categories do not.

Cheers


History

Comments
avatar
Date: 2012-12-03 19:18
Posted By: Cameron (smokeycam)

OK, further investigation shows that the parseTree javascipt function is not
parsing all of the LI items. Seems that the markup is slighty wrong eg

Current:

<ul>
      <li>ELEMENT</li>
      <li>ELEMENT</li>
      <li>ELEMENT</li>
           <ul>
      <li>ELEMENT</li>
      <li>ELEMENT</li>
      <li>ELEMENT</li>
           </ul>
      <li>ELEMENT</li>
</ul>

Should be:

<ul>
      <li>ELEMENT</li>
      <li>ELEMENT</li>
      <li>ELEMENT
           <ul>
      <li>ELEMENT</li>
      <li>ELEMENT</li>
      <li>ELEMENT</li>
           </ul>
       </li> <-- Child UL Wrapped in parent LI
      <li>ELEMENT</li>
</ul>

So, i tweaked the ordercategory.tml to the following (it appears to be the
closest I can get to it, but feel free to modify it..):

Line 59 - 97

{$startform}
        <ul class="sortableList sortable">

            {if $itemcount > 0}
                {foreach from=$items item=entry name="categorylist"}

                    {assign var="hierarchycount" value="."|explode:$hierarchy}
{assign var="hierarchycurrentcount"
value="."|explode:$entry->hierarchy_position}

                    {assign var='length' value=$entry->hierarchy|strlen}


{if $smarty.foreach.categorylist.first==false &&
$parent_id!=$entry->parent_id && $hierarchycount|@count <= 
$hierarchycurrentcount|@count}
                        <ul>
{elseif $smarty.foreach.categorylist.first==false &&
$parent_id!=$entry->parent_id}
{math equation="x - y" x=$hierarchycount|@count
y=$hierarchycurrentcount|@count assign="depth"}
{repeat string="</li></ul>" times=$depth}{else}{if
$smarty.foreach.categorylist.first==false}</li>{/if}
                        {/if}


  <li id="category_{$entry->category_id}">
<div
class="label"><span>&nbsp;</span>{$entry->category_id}:&nbsp;{$entry->category_name}<em>{$entry->hierarchy}</em></div>


  {assign var="hierarchy" value=$entry->hierarchy_position}
  {assign var="parent_id" value=$entry->parent_id}

  {if $smarty.foreach.categorylist.last}</li>{/if}

{if $smarty.foreach.categorylist.last && $parent_id==$entry->parent_id &&
$length > 6}</ul>{/if}
   {/foreach}
  {/if}
</ul>

    <div class="pagoeverflow">
<input type="submit" name="{$actionid}submit" class="button save"
value="{'submit'|lang}"/>
        <input type="submit" name="{$actionid}cancel" value="{'cancel'|lang}"/>
    </div>
    {$endform}

 
      
avatar
Date: 2012-12-06 18:13
Posted By: Zdeno Kuzmany (xxl)

Fixed in SVN
      
Updates

Updated: 2012-12-06 18:13
resolution_id: 6 => 7

Updated: 2012-09-25 04:57
resolution_id: => 6