Skip to content

Commit

Permalink
[bug] [33314] Fix Undefined variable: $originalOrders in com_tags
Browse files Browse the repository at this point in the history
Close #3150
  • Loading branch information
radiant-tech authored and wilsonge committed Apr 23, 2014
1 parent 0da4c39 commit 0cfc0ea
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,18 @@ public function rebuild()
/**
* Save the manual order inputs from the categories list page.
*
* @return void
* @return void
*
* @since 1.6
* @since 1.6
* @see JControllerAdmin::saveorder()
* @deprecated 4.0
*/
public function saveorder()
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

JLog::add('CategoriesControllerCategories::saveorder() is deprecated. Function will be removed in 4.0', JLog::WARNING, 'deprecated');

// Get the arrays from the Request
$order = $this->input->post->get('order', null, 'array');
$originalOrder = explode(',', $this->input->getString('original_order_values'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
$listDirn = $this->escape($this->state->get('list.direction'));
$ordering = ($listOrder == 'a.lft');
$saveOrder = ($listOrder == 'a.lft' && strtolower($listDirn) == 'asc');
$originalOrders = array();

if ($saveOrder)
{
Expand Down Expand Up @@ -215,7 +214,6 @@
<input type="hidden" name="extension" value="<?php echo $extension; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="original_order_values" value="<?php echo implode($originalOrders, ','); ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
10 changes: 10 additions & 0 deletions administrator/components/com_menus/controllers/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,20 @@ public function rebuild()
}
}

/**
* Save the manual order inputs from the menu items list view
*
* @return void
*
* @see JControllerAdmin::saveorder()
* @deprecated 4.0
*/
public function saveorder()
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

JLog::add('MenusControllerItems::saveorder() is deprecated. Function will be removed in 4.0', JLog::WARNING, 'deprecated');

// Get the arrays from the Request
$order = $this->input->post->get('order', null, 'array');
$originalOrder = explode(',', $this->input->getString('original_order_values'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
$ordering = ($listOrder == 'a.lft');
$canOrder = $user->authorise('core.edit.state', 'com_menus');
$saveOrder = ($listOrder == 'a.lft' && strtolower($listDirn) == 'asc');
$originalOrders = array();

if ($saveOrder)
{
Expand Down Expand Up @@ -249,7 +248,6 @@

<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="original_order_values" value="<?php echo implode($originalOrders, ','); ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
2 changes: 0 additions & 2 deletions administrator/components/com_tags/views/tags/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
</tfoot>
<tbody>
<?php
$originalOrders = array();
foreach ($this->items as $i => $item) :
$orderkey = array_search($item->id, $this->ordering[$item->parent_id]);
$canCreate = $user->authorise('core.create', 'com_tags');
Expand Down Expand Up @@ -232,7 +231,6 @@
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<input type="hidden" name="original_order_values" value="<?php echo implode($originalOrders, ','); ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
</thead>

<tbody>
<?php $originalOrders = array(); ?>
<?php foreach ($this->items as $i => $item) : ?>
<?php
$orderkey = array_search($item->id, $this->ordering[$item->parent_id]);
Expand Down Expand Up @@ -159,7 +158,6 @@
<?php endif; ?>
<?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?>
<input type="text" name="order[]" value="<?php echo $orderkey + 1; ?>" <?php echo $disabled ?> class="text-area-order" title="<?php echo $item->title; ?> order" />
<?php $originalOrders[] = $orderkey + 1; ?>
<?php else : ?>
<?php echo $orderkey + 1; ?>
<?php endif; ?>
Expand Down Expand Up @@ -201,7 +199,6 @@
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<input type="hidden" name="original_order_values" value="<?php echo implode($originalOrders, ','); ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@

<tbody>
<?php
$originalOrders = array();
foreach ($this->items as $i => $item) :
$orderkey = array_search($item->id, $this->ordering[$item->parent_id]);
$canCreate = $user->authorise('core.create', 'com_menus');
Expand Down Expand Up @@ -180,7 +179,6 @@
<?php endif; ?>
<?php $disabled = $saveOrder ? '' : 'disabled="disabled"'; ?>
<input type="text" name="order[]" value="<?php echo $orderkey + 1;?>" <?php echo $disabled ?> class="text-area-order" title="<?php echo $item->title; ?> order" />
<?php $originalOrders[] = $orderkey + 1; ?>
<?php else : ?>
<?php echo $orderkey + 1;?>
<?php endif; ?>
Expand Down Expand Up @@ -244,7 +242,6 @@
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<input type="hidden" name="original_order_values" value="<?php echo implode($originalOrders, ','); ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>

0 comments on commit 0cfc0ea

Please sign in to comment.